· 6 years ago · Jun 10, 2019, 04:14 AM
1if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2local Player,Mouse,mouse,UserInputService,ContextActionService = owner
3local RealPlayer = Player
4do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end,__call=function(self,...)local t=rawget(self,"_RealService")if t then return t(...)end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return self[t]end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;x.RunService=v({RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")setmetatable(x,{__index=function(self,t)return r:GetService(t)or typeof(r[t])=="function"and function(m,...)return r[t](r,...)end or r[t]end,__newindex=s.__newindex,__call=s.__call})game,owner=x,x.Players.LocalPlayer end
5
6function weldBetween(a, b)
7 --Make a new Weld and Parent it to a.
8 weld = Instance.new("ManualWeld", a)
9 --Get the CFrame of b relative to a.
10 weld.C0 = a.CFrame:inverse() * b.CFrame
11 --Set the Part0 and Part1 properties respectively
12 weld.Part0 = a
13 weld.Part1 = b
14 --Return the reference to the weld so that you can change it later.
15 return weld
16end
17
18--- THE BELOW WILL FILTER ALL OBJS THAT APPEAR IN WORKSPACE WITH A TEXT PROPERTY
19do
20 local filteredMessages = { ['___'] = '___' };
21 local onPropertyChanged = function (obj)
22 if (obj:isDescendantOf (workspace)) then
23 local objText = obj.Text;
24
25 if (objText ~= '___' and objText:find '(%S)') then
26 if (filteredMessages [objText] and filteredMessages [objText] ~= objText) then
27 obj.Text = filteredMessages [objText];
28 elseif (not filteredMessages [objText]) then
29 obj.Text = '___';
30
31 local filtered = game:service 'Chat':FilterStringForBroadcast (objText, game:service 'Players'.localPlayer);
32
33 filteredMessages [objText] = filtered;
34 filteredMessages [filtered] = filtered;
35
36 obj.Text = filtered;
37 end;
38 end;
39 end;
40 end;
41
42 local newInstance = Instance.new;
43 Instance = {
44 new = function (class, parent)
45 local obj = newInstance (class, parent);
46
47 if (pcall (function()return obj.Text;end)) then
48 obj:getPropertyChangedSignal ('Parent'):connect (function () onPropertyChanged (obj) end);
49 obj:getPropertyChangedSignal ('Text'):connect (function() onPropertyChanged (obj) end);
50 end;
51
52 return obj;
53 end;
54 };
55end;
56--- THE ABOVE
57
58--Converted with ttyyuu12345's model to script plugin v4
59function sandbox(var,func)
60 local env = getfenv(func)
61 local newenv = setmetatable({},{
62 __index = function(self,k)
63 if k=="script" then
64 return var
65 else
66 return env[k]
67 end
68 end,
69 })
70 setfenv(func,newenv)
71 return func
72end
73cors = {}
74mas = Instance.new("Model",game:GetService("Lighting"))
75Model0 = Instance.new("Model")
76Part1 = Instance.new("Part")
77SpecialMesh2 = Instance.new("SpecialMesh")
78Part3 = Instance.new("Part")
79SpecialMesh4 = Instance.new("SpecialMesh")
80Part5 = Instance.new("Part")
81SpecialMesh6 = Instance.new("SpecialMesh")
82Script7 = Instance.new("Script")
83Model8 = Instance.new("Model")
84Part9 = Instance.new("Part")
85SurfaceGui10 = Instance.new("SurfaceGui")
86TextLabel11 = Instance.new("TextLabel")
87Part12 = Instance.new("Part")
88Part13 = Instance.new("Part")
89Part14 = Instance.new("Part")
90Part15 = Instance.new("Part")
91Part16 = Instance.new("Part")
92Part17 = Instance.new("Part")
93Part18 = Instance.new("Part")
94Part19 = Instance.new("Part")
95Part20 = Instance.new("Part")
96Part21 = Instance.new("Part")
97Part22 = Instance.new("Part")
98Part23 = Instance.new("Part")
99Part24 = Instance.new("Part")
100Part25 = Instance.new("Part")
101Script26 = Instance.new("Script")
102Model0.Name = "Helmet"
103Model0.Parent = mas
104Model0.PrimaryPart = Part1
105Part1.Name = "Center"
106Part1.Parent = Model0
107Part1.Transparency = 1
108Part1.Rotation = Vector3.new(0.340000004, -1.46999991, 0.239999995)
109Part1.CanCollide = false
110Part1.FormFactor = Enum.FormFactor.Symmetric
111Part1.Size = Vector3.new(2, 1, 1)
112Part1.CFrame = CFrame.new(72.9180908, 6.41160107, -177.899567, 0.999660254, -0.0041671074, -0.0257321466, 0.00401700102, 0.999974668, -0.00588235958, 0.0257560052, 0.00577699533, 0.999651611)
113Part1.TopSurface = Enum.SurfaceType.Smooth
114Part1.Position = Vector3.new(72.9180908, 6.41160107, -177.899567)
115Part1.Orientation = Vector3.new(0.340000004, -1.46999991, 0.229999989)
116SpecialMesh2.Parent = Part1
117SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
118SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
119Part3.Parent = Model0
120Part3.Rotation = Vector3.new(4.1500001, -1.28999996, 0.429999977)
121Part3.CanCollide = false
122Part3.FormFactor = Enum.FormFactor.Symmetric
123Part3.Size = Vector3.new(2, 1, 1)
124Part3.CFrame = CFrame.new(72.9490585, 6.97505713, -177.815628, 0.999717772, -0.00752264773, -0.0225359276, 0.00587299839, 0.997358978, -0.0723927915, 0.0230209939, 0.0722400099, 0.997121572)
125Part3.BottomSurface = Enum.SurfaceType.Smooth
126Part3.TopSurface = Enum.SurfaceType.Smooth
127Part3.Position = Vector3.new(72.9490585, 6.97505713, -177.815628)
128Part3.Orientation = Vector3.new(4.1500001, -1.28999996, 0.340000004)
129SpecialMesh4.Parent = Part3
130SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=25648271"
131SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
132SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=28664001"
133SpecialMesh4.MeshType = Enum.MeshType.FileMesh
134SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
135Part5.Parent = Model0
136Part5.BrickColor = BrickColor.new("Really black")
137Part5.Rotation = Vector3.new(0.839999974, -1.33999991, 1.26999998)
138Part5.CanCollide = false
139Part5.FormFactor = Enum.FormFactor.Plate
140Part5.Size = Vector3.new(2, 1.20000005, 1)
141Part5.CFrame = CFrame.new(72.9557266, 6.47859812, -177.850067, 0.999482214, -0.0220845398, -0.0234031118, 0.0217460059, 0.999656618, -0.0146224797, 0.023718005, 0.0141059821, 0.999619246)
142Part5.BottomSurface = Enum.SurfaceType.Smooth
143Part5.TopSurface = Enum.SurfaceType.Smooth
144Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
145Part5.Position = Vector3.new(72.9557266, 6.47859812, -177.850067)
146Part5.Orientation = Vector3.new(0.839999974, -1.33999991, 1.25)
147Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
148SpecialMesh6.Parent = Part5
149SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=1286427"
150SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
151SpecialMesh6.MeshType = Enum.MeshType.FileMesh
152SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
153Script7.Name = "qPerfectionWeld"
154Script7.Parent = Model0
155table.insert(cors,sandbox(Script7,function()
156-- Created by Quenty (@Quenty, follow me on twitter).
157-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
158-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
159
160--[[ INSTRUCTIONS
161- Place in the model
162- Make sure model is anchored
163- That's it. It will weld the model and all children.
164
165THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
166THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
167THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
168THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
169THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
170THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
171THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
172THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
173
174This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
175]]
176
177--[[ DOCUMENTATION
178- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
179- Will work in PBS servers
180- Will work as long as it starts out with the part anchored
181- Stores the relative CFrame as a CFrame value
182- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
183- Utilizes a recursive algorith to find all parts in the model
184- Will reweld on script reparent if the script is initially parented to a tool.
185- Welds as fast as possible
186]]
187
188-- qPerfectionWeld.lua
189-- Created 10/6/2014
190-- Author: Quenty
191-- Version 1.0.3
192
193-- Updated 10/14/2014 - Updated to 1.0.1
194--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
195
196-- Updated 10/14/2014 - Updated to 1.0.2
197--- Fixed bug fix.
198
199-- Updated 10/14/2014 - Updated to 1.0.3
200--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
201
202local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
203
204
205local function CallOnChildren(Instance, FunctionToCall)
206 -- Calls a function on each of the children of a certain object, using recursion.
207
208 FunctionToCall(Instance)
209
210 for _, Child in next, Instance:GetChildren() do
211 CallOnChildren(Child, FunctionToCall)
212 end
213end
214
215local function GetNearestParent(Instance, ClassName)
216 -- Returns the nearest parent of a certain class, or returns nil
217
218 local Ancestor = Instance
219 repeat
220 Ancestor = Ancestor.Parent
221 if Ancestor == nil then
222 return nil
223 end
224 until Ancestor:IsA(ClassName)
225
226 return Ancestor
227end
228
229local function GetBricks(StartInstance)
230 local List = {}
231
232 -- if StartInstance:IsA("BasePart") then
233 -- List[#List+1] = StartInstance
234 -- end
235
236 CallOnChildren(StartInstance, function(Item)
237 if Item:IsA("BasePart") then
238 List[#List+1] = Item;
239 end
240 end)
241
242 return List
243end
244
245local function Modify(Instance, Values)
246 -- Modifies an Instance by using a table.
247
248 assert(type(Values) == "table", "Values is not a table");
249
250 for Index, Value in next, Values do
251 if type(Index) == "number" then
252 Value.Parent = Instance
253 else
254 Instance[Index] = Value
255 end
256 end
257 return Instance
258end
259
260local function Make(ClassType, Properties)
261 -- Using a syntax hack to create a nice way to Make new items.
262
263 return Modify(Instance.new(ClassType), Properties)
264end
265
266local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
267local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
268
269local function HasWheelJoint(Part)
270 for _, SurfaceName in pairs(Surfaces) do
271 for _, HingSurfaceName in pairs(HingSurfaces) do
272 if Part[SurfaceName].Name == HingSurfaceName then
273 return true
274 end
275 end
276 end
277
278 return false
279end
280
281local function ShouldBreakJoints(Part)
282 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
283 -- definitely some edge cases.
284
285 if NEVER_BREAK_JOINTS then
286 return false
287 end
288
289 if HasWheelJoint(Part) then
290 return false
291 end
292
293 local Connected = Part:GetConnectedParts()
294
295 if #Connected == 1 then
296 return false
297 end
298
299 for _, Item in pairs(Connected) do
300 if HasWheelJoint(Item) then
301 return false
302 elseif not Item:IsDescendantOf(script.Parent) then
303 return false
304 end
305 end
306
307 return true
308end
309
310local function WeldTogether(Part0, Part1, JointType, WeldParent)
311 --- Weld's 2 parts together
312 -- @param Part0 The first part
313 -- @param Part1 The second part (Dependent part most of the time).
314 -- @param [JointType] The type of joint. Defaults to weld.
315 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
316 -- @return The weld created.
317
318 JointType = JointType or "Weld"
319 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
320
321 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
322 Modify(NewWeld, {
323 Name = "qCFrameWeldThingy";
324 Part0 = Part0;
325 Part1 = Part1;
326 C0 = CFrame.new();--Part0.CFrame:inverse();
327 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
328 Parent = Part1;
329 })
330
331 if not RelativeValue then
332 RelativeValue = Make("CFrameValue", {
333 Parent = Part1;
334 Name = "qRelativeCFrameWeldValue";
335 Archivable = true;
336 Value = NewWeld.C1;
337 })
338 end
339
340 return NewWeld
341end
342
343local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
344 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
345 -- @param MainPart The part to weld the model to (can be in the model).
346 -- @param [JointType] The type of joint. Defaults to weld.
347 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
348
349 for _, Part in pairs(Parts) do
350 if ShouldBreakJoints(Part) then
351 Part:BreakJoints()
352 end
353 end
354
355 for _, Part in pairs(Parts) do
356 if Part ~= MainPart then
357 WeldTogether(MainPart, Part, JointType, MainPart)
358 end
359 end
360
361 if not DoNotUnanchor then
362 for _, Part in pairs(Parts) do
363 Part.Anchored = false
364 end
365 MainPart.Anchored = false
366 end
367end
368
369local function PerfectionWeld()
370 local Tool = GetNearestParent(script, "Tool")
371
372 local Parts = GetBricks(script.Parent)
373 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
374
375 if PrimaryPart then
376 WeldParts(Parts, PrimaryPart, "Weld", false)
377 else
378 warn("qWeld - Unable to weld part")
379 end
380
381 return Tool
382end
383
384local Tool = PerfectionWeld()
385
386
387if Tool and script.ClassName == "Script" then
388 --- Don't bother with local scripts
389
390 script.Parent.AncestryChanged:connect(function()
391 PerfectionWeld()
392 end)
393end
394
395-- Created by Quenty (@Quenty, follow me on twitter).
396
397end))
398Model8.Name = "Vest"
399Model8.Parent = mas
400Model8.PrimaryPart = Part25
401Part9.Name = "Sign"
402Part9.Parent = Model8
403Part9.Material = Enum.Material.Metal
404Part9.BrickColor = BrickColor.new("Sand red")
405Part9.Transparency = 1
406Part9.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
407Part9.CanCollide = false
408Part9.FormFactor = Enum.FormFactor.Symmetric
409Part9.Size = Vector3.new(1.30000019, 0.550000012, 0.200000003)
410Part9.CFrame = CFrame.new(72.9406586, 5.29043913, -177.003342, -0.999780118, 0.0131011065, 0.0163731799, 0.0133110015, 0.999829769, 0.0127768656, -0.0162030011, 0.0129919993, -0.99978435)
411Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
412Part9.Position = Vector3.new(72.9406586, 5.29043913, -177.003342)
413Part9.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
414Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
415SurfaceGui10.Parent = Part9
416SurfaceGui10.CanvasSize = Vector2.new(200, 100)
417TextLabel11.Parent = SurfaceGui10
418TextLabel11.Transparency = 0
419TextLabel11.Size = UDim2.new(1, 0, 1, 0)
420TextLabel11.Text = "POLICE"
421TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
422TextLabel11.BackgroundTransparency = 1
423TextLabel11.Font = Enum.Font.SourceSansBold
424TextLabel11.FontSize = Enum.FontSize.Size96
425TextLabel11.TextColor3 = Color3.new(1, 1, 1)
426TextLabel11.TextScaled = true
427TextLabel11.TextStrokeTransparency = 0
428TextLabel11.TextWrapped = true
429Part12.Parent = Model8
430Part12.Material = Enum.Material.Concrete
431Part12.BrickColor = BrickColor.new("Black")
432Part12.Rotation = Vector3.new(174.729996, 82.8499985, -173.940002)
433Part12.CanCollide = false
434Part12.FormFactor = Enum.FormFactor.Custom
435Part12.Size = Vector3.new(0.200000003, 0.71999979, 0.449999988)
436Part12.CFrame = CFrame.new(72.4569855, 4.71349096, -178.388519, -0.123689957, 0.0131369764, 0.992233932, 0.0145219946, 0.999829352, -0.0114272516, -0.99221462, 0.0129957823, -0.123859614)
437Part12.BottomSurface = Enum.SurfaceType.Smooth
438Part12.TopSurface = Enum.SurfaceType.Smooth
439Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
440Part12.Position = Vector3.new(72.4569855, 4.71349096, -178.388519)
441Part12.Orientation = Vector3.new(0.649999976, 97.1199951, 0.829999983)
442Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
443Part13.Parent = Model8
444Part13.Material = Enum.Material.Concrete
445Part13.BrickColor = BrickColor.new("Black")
446Part13.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
447Part13.CanCollide = false
448Part13.FormFactor = Enum.FormFactor.Custom
449Part13.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
450Part13.CFrame = CFrame.new(72.3412857, 5.96526623, -177.624023, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
451Part13.BottomSurface = Enum.SurfaceType.Smooth
452Part13.TopSurface = Enum.SurfaceType.Smooth
453Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
454Part13.Position = Vector3.new(72.3412857, 5.96526623, -177.624023)
455Part13.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
456Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
457Part14.Parent = Model8
458Part14.Material = Enum.Material.Concrete
459Part14.BrickColor = BrickColor.new("Black")
460Part14.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
461Part14.CanCollide = false
462Part14.FormFactor = Enum.FormFactor.Custom
463Part14.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
464Part14.CFrame = CFrame.new(72.1091156, 4.81766319, -177.202225, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
465Part14.BottomSurface = Enum.SurfaceType.Smooth
466Part14.TopSurface = Enum.SurfaceType.Smooth
467Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
468Part14.Position = Vector3.new(72.1091156, 4.81766319, -177.202225)
469Part14.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
470Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
471Part15.Parent = Model8
472Part15.Material = Enum.Material.Concrete
473Part15.BrickColor = BrickColor.new("Black")
474Part15.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
475Part15.CanCollide = false
476Part15.FormFactor = Enum.FormFactor.Custom
477Part15.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
478Part15.CFrame = CFrame.new(73.7588272, 4.80563593, -177.175812, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
479Part15.BottomSurface = Enum.SurfaceType.Smooth
480Part15.TopSurface = Enum.SurfaceType.Smooth
481Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
482Part15.Position = Vector3.new(73.7588272, 4.80563593, -177.175812)
483Part15.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
484Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
485Part16.Parent = Model8
486Part16.Material = Enum.Material.Concrete
487Part16.BrickColor = BrickColor.new("Black")
488Part16.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
489Part16.CanCollide = false
490Part16.FormFactor = Enum.FormFactor.Custom
491Part16.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
492Part16.CFrame = CFrame.new(72.0599594, 4.75864077, -177.613922, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
493Part16.BottomSurface = Enum.SurfaceType.Smooth
494Part16.TopSurface = Enum.SurfaceType.Smooth
495Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
496Part16.Position = Vector3.new(72.0599594, 4.75864077, -177.613922)
497Part16.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
498Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
499Part17.Parent = Model8
500Part17.Material = Enum.Material.Concrete
501Part17.BrickColor = BrickColor.new("Black")
502Part17.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
503Part17.CanCollide = false
504Part17.FormFactor = Enum.FormFactor.Custom
505Part17.Size = Vector3.new(0.359999925, 1.74999905, 1.47999918)
506Part17.CFrame = CFrame.new(72.9529877, 5.08878517, -178.135315, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
507Part17.BottomSurface = Enum.SurfaceType.Smooth
508Part17.TopSurface = Enum.SurfaceType.Smooth
509Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
510Part17.Position = Vector3.new(72.9529877, 5.08878517, -178.135315)
511Part17.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
512Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
513Part18.Parent = Model8
514Part18.Material = Enum.Material.Concrete
515Part18.BrickColor = BrickColor.new("Black")
516Part18.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
517Part18.CanCollide = false
518Part18.FormFactor = Enum.FormFactor.Custom
519Part18.Size = Vector3.new(0.359999806, 1.7899996, 1.47999918)
520Part18.CFrame = CFrame.new(72.9363556, 5.08558512, -177.105606, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
521Part18.BottomSurface = Enum.SurfaceType.Smooth
522Part18.TopSurface = Enum.SurfaceType.Smooth
523Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
524Part18.Position = Vector3.new(72.9363556, 5.08558512, -177.105606)
525Part18.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
526Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
527Part19.Parent = Model8
528Part19.Material = Enum.Material.Concrete
529Part19.BrickColor = BrickColor.new("Black")
530Part19.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
531Part19.CanCollide = false
532Part19.FormFactor = Enum.FormFactor.Custom
533Part19.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
534Part19.CFrame = CFrame.new(73.5408936, 5.93928385, -177.604767, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
535Part19.BottomSurface = Enum.SurfaceType.Smooth
536Part19.TopSurface = Enum.SurfaceType.Smooth
537Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
538Part19.Position = Vector3.new(73.5408936, 5.93928385, -177.604767)
539Part19.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
540Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
541Part20.Parent = Model8
542Part20.Material = Enum.Material.Concrete
543Part20.BrickColor = BrickColor.new("Black")
544Part20.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
545Part20.CanCollide = false
546Part20.FormFactor = Enum.FormFactor.Custom
547Part20.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
548Part20.CFrame = CFrame.new(72.1244736, 4.82962418, -178.142212, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
549Part20.BottomSurface = Enum.SurfaceType.Smooth
550Part20.TopSurface = Enum.SurfaceType.Smooth
551Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
552Part20.Position = Vector3.new(72.1244736, 4.82962418, -178.142212)
553Part20.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
554Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
555Part21.Parent = Model8
556Part21.Material = Enum.Material.Concrete
557Part21.BrickColor = BrickColor.new("Black")
558Part21.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
559Part21.CanCollide = false
560Part21.FormFactor = Enum.FormFactor.Custom
561Part21.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
562Part21.CFrame = CFrame.new(73.7796783, 4.74567795, -177.585907, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
563Part21.BottomSurface = Enum.SurfaceType.Smooth
564Part21.TopSurface = Enum.SurfaceType.Smooth
565Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
566Part21.Position = Vector3.new(73.7796783, 4.74567795, -177.585907)
567Part21.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
568Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
569Part22.Parent = Model8
570Part22.Material = Enum.Material.Concrete
571Part22.BrickColor = BrickColor.new("Black")
572Part22.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
573Part22.CanCollide = false
574Part22.FormFactor = Enum.FormFactor.Custom
575Part22.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
576Part22.CFrame = CFrame.new(73.7241669, 4.80833578, -178.116241, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
577Part22.BottomSurface = Enum.SurfaceType.Smooth
578Part22.TopSurface = Enum.SurfaceType.Smooth
579Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
580Part22.Position = Vector3.new(73.7241669, 4.80833578, -178.116241)
581Part22.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
582Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
583Part23.Parent = Model8
584Part23.Material = Enum.Material.Concrete
585Part23.BrickColor = BrickColor.new("Black")
586Part23.Rotation = Vector3.new(6.08999968, 81.9700012, -5.4000001)
587Part23.CanCollide = false
588Part23.FormFactor = Enum.FormFactor.Custom
589Part23.Size = Vector3.new(0.200000003, 0.720000088, 0.449999988)
590Part23.CFrame = CFrame.new(73.4771957, 4.71013212, -178.391571, 0.139059052, 0.0131340493, 0.990197003, 0.0110520059, 0.999829233, -0.0148139065, -0.990222454, 0.0130036715, 0.138890132)
591Part23.BottomSurface = Enum.SurfaceType.Smooth
592Part23.TopSurface = Enum.SurfaceType.Smooth
593Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
594Part23.Position = Vector3.new(73.4771957, 4.71013212, -178.391571)
595Part23.Orientation = Vector3.new(0.849999964, 82.0199966, 0.629999995)
596Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
597Part24.Parent = Model8
598Part24.Material = Enum.Material.Concrete
599Part24.BrickColor = BrickColor.new("Black")
600Part24.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
601Part24.CanCollide = false
602Part24.FormFactor = Enum.FormFactor.Custom
603Part24.Size = Vector3.new(0.200000003, 0.729999781, 0.449999988)
604Part24.CFrame = CFrame.new(72.9676437, 4.71220207, -178.419983, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
605Part24.BottomSurface = Enum.SurfaceType.Smooth
606Part24.TopSurface = Enum.SurfaceType.Smooth
607Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
608Part24.Position = Vector3.new(72.9676437, 4.71220207, -178.419983)
609Part24.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
610Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
611Part25.Name = "Center"
612Part25.Parent = Model8
613Part25.Transparency = 1
614Part25.Rotation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
615Part25.CanCollide = false
616Part25.FormFactor = Enum.FormFactor.Symmetric
617Part25.Size = Vector3.new(2, 2, 1)
618Part25.CFrame = CFrame.new(72.9311523, 4.96114111, -177.610779, 0.999788582, 0.00987272803, -0.0180385765, -0.00989200547, 0.999950647, -0.000979764038, 0.0180280115, 0.00115799461, 0.999836862)
619Part25.Position = Vector3.new(72.9311523, 4.96114111, -177.610779)
620Part25.Orientation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
621Script26.Name = "qPerfectionWeld"
622Script26.Parent = Model8
623table.insert(cors,sandbox(Script26,function()
624-- Created by Quenty (@Quenty, follow me on twitter).
625-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
626-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
627
628--[[ INSTRUCTIONS
629- Place in the model
630- Make sure model is anchored
631- That's it. It will weld the model and all children.
632
633THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
634THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
635THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
636THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
637THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
638THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
639THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
640THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
641
642This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
643]]
644
645--[[ DOCUMENTATION
646- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
647- Will work in PBS servers
648- Will work as long as it starts out with the part anchored
649- Stores the relative CFrame as a CFrame value
650- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
651- Utilizes a recursive algorith to find all parts in the model
652- Will reweld on script reparent if the script is initially parented to a tool.
653- Welds as fast as possible
654]]
655
656-- qPerfectionWeld.lua
657-- Created 10/6/2014
658-- Author: Quenty
659-- Version 1.0.3
660
661-- Updated 10/14/2014 - Updated to 1.0.1
662--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
663
664-- Updated 10/14/2014 - Updated to 1.0.2
665--- Fixed bug fix.
666
667-- Updated 10/14/2014 - Updated to 1.0.3
668--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
669
670local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
671
672
673local function CallOnChildren(Instance, FunctionToCall)
674 -- Calls a function on each of the children of a certain object, using recursion.
675
676 FunctionToCall(Instance)
677
678 for _, Child in next, Instance:GetChildren() do
679 CallOnChildren(Child, FunctionToCall)
680 end
681end
682
683local function GetNearestParent(Instance, ClassName)
684 -- Returns the nearest parent of a certain class, or returns nil
685
686 local Ancestor = Instance
687 repeat
688 Ancestor = Ancestor.Parent
689 if Ancestor == nil then
690 return nil
691 end
692 until Ancestor:IsA(ClassName)
693
694 return Ancestor
695end
696
697local function GetBricks(StartInstance)
698 local List = {}
699
700 -- if StartInstance:IsA("BasePart") then
701 -- List[#List+1] = StartInstance
702 -- end
703
704 CallOnChildren(StartInstance, function(Item)
705 if Item:IsA("BasePart") then
706 List[#List+1] = Item;
707 end
708 end)
709
710 return List
711end
712
713local function Modify(Instance, Values)
714 -- Modifies an Instance by using a table.
715
716 assert(type(Values) == "table", "Values is not a table");
717
718 for Index, Value in next, Values do
719 if type(Index) == "number" then
720 Value.Parent = Instance
721 else
722 Instance[Index] = Value
723 end
724 end
725 return Instance
726end
727
728local function Make(ClassType, Properties)
729 -- Using a syntax hack to create a nice way to Make new items.
730
731 return Modify(Instance.new(ClassType), Properties)
732end
733
734local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
735local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
736
737local function HasWheelJoint(Part)
738 for _, SurfaceName in pairs(Surfaces) do
739 for _, HingSurfaceName in pairs(HingSurfaces) do
740 if Part[SurfaceName].Name == HingSurfaceName then
741 return true
742 end
743 end
744 end
745
746 return false
747end
748
749local function ShouldBreakJoints(Part)
750 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
751 -- definitely some edge cases.
752
753 if NEVER_BREAK_JOINTS then
754 return false
755 end
756
757 if HasWheelJoint(Part) then
758 return false
759 end
760
761 local Connected = Part:GetConnectedParts()
762
763 if #Connected == 1 then
764 return false
765 end
766
767 for _, Item in pairs(Connected) do
768 if HasWheelJoint(Item) then
769 return false
770 elseif not Item:IsDescendantOf(script.Parent) then
771 return false
772 end
773 end
774
775 return true
776end
777
778local function WeldTogether(Part0, Part1, JointType, WeldParent)
779 --- Weld's 2 parts together
780 -- @param Part0 The first part
781 -- @param Part1 The second part (Dependent part most of the time).
782 -- @param [JointType] The type of joint. Defaults to weld.
783 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
784 -- @return The weld created.
785
786 JointType = JointType or "Weld"
787 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
788
789 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
790 Modify(NewWeld, {
791 Name = "qCFrameWeldThingy";
792 Part0 = Part0;
793 Part1 = Part1;
794 C0 = CFrame.new();--Part0.CFrame:inverse();
795 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
796 Parent = Part1;
797 })
798
799 if not RelativeValue then
800 RelativeValue = Make("CFrameValue", {
801 Parent = Part1;
802 Name = "qRelativeCFrameWeldValue";
803 Archivable = true;
804 Value = NewWeld.C1;
805 })
806 end
807
808 return NewWeld
809end
810
811local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
812 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
813 -- @param MainPart The part to weld the model to (can be in the model).
814 -- @param [JointType] The type of joint. Defaults to weld.
815 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
816
817 for _, Part in pairs(Parts) do
818 if ShouldBreakJoints(Part) then
819 Part:BreakJoints()
820 end
821 end
822
823 for _, Part in pairs(Parts) do
824 if Part ~= MainPart then
825 WeldTogether(MainPart, Part, JointType, MainPart)
826 end
827 end
828
829 if not DoNotUnanchor then
830 for _, Part in pairs(Parts) do
831 Part.Anchored = false
832 end
833 MainPart.Anchored = false
834 end
835end
836
837local function PerfectionWeld()
838 local Tool = GetNearestParent(script, "Tool")
839
840 local Parts = GetBricks(script.Parent)
841 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
842
843 if PrimaryPart then
844 WeldParts(Parts, PrimaryPart, "Weld", false)
845 else
846 warn("qWeld - Unable to weld part")
847 end
848
849 return Tool
850end
851
852local Tool = PerfectionWeld()
853
854
855if Tool and script.ClassName == "Script" then
856 --- Don't bother with local scripts
857
858 script.Parent.AncestryChanged:connect(function()
859 PerfectionWeld()
860 end)
861end
862
863-- Created by Quenty (@Quenty, follow me on twitter).
864
865end))
866
867delay(0.3, function()
868Part25.CFrame = game:GetService("Players").LocalPlayer.Character.Torso.CFrame
869weldBetween(game:GetService("Players").LocalPlayer.Character.Torso, Part25)
870
871Part1.CFrame = game:GetService("Players").LocalPlayer.Character.Head.CFrame
872weldBetween(game:GetService("Players").LocalPlayer.Character.Head, Part1)
873
874for i,v in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren()) do
875 if v:IsA("Accessory") or v:IsA("Hat") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("CharacterMesh") then
876 v:Destroy()
877 end
878end
879
880shirt = Instance.new("Shirt", game:GetService("Players").LocalPlayer.Character)
881shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=104018587"
882
883pants = Instance.new("Pants", game:GetService("Players").LocalPlayer.Character)
884pants.PantsTemplate = "http://www.roblox.com/asset/?id=104018712"
885
886if game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors") then
887 game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors").HeadColor = BrickColor.new("Pastel yellow")
888end
889end)
890
891for i,v in pairs(mas:GetChildren()) do
892 v.Parent = game:GetService("Players").LocalPlayer.Character
893 pcall(function() v:MakeJoints() end)
894end
895mas:Destroy()
896for i,v in pairs(cors) do
897 spawn(function()
898 pcall(v)
899 end)
900end
901
902--Converted with ttyyuu12345's model to script plugin v4
903function sandbox(var,func)
904 local env = getfenv(func)
905 local newenv = setmetatable({},{
906 __index = function(self,k)
907 if k=="script" then
908 return var
909 else
910 return env[k]
911 end
912 end,
913 })
914 setfenv(func,newenv)
915 return func
916end
917cors = {}
918mas = Instance.new("Model",game:GetService("Lighting"))
919Tool0 = Instance.new("Tool")
920ScreenGui1 = Instance.new("ScreenGui")
921Frame2 = Instance.new("Frame")
922Frame3 = Instance.new("Frame")
923Frame4 = Instance.new("Frame")
924Frame5 = Instance.new("Frame")
925Frame6 = Instance.new("Frame")
926ImageLabel7 = Instance.new("ImageLabel")
927TextLabel8 = Instance.new("TextLabel")
928Frame9 = Instance.new("Frame")
929TextLabel10 = Instance.new("TextLabel")
930TextLabel11 = Instance.new("TextLabel")
931TextLabel12 = Instance.new("TextLabel")
932LocalScript13 = Instance.new("LocalScript")
933Animation14 = Instance.new("Animation")
934Animation15 = Instance.new("Animation")
935Animation16 = Instance.new("Animation")
936LocalScript17 = Instance.new("LocalScript")
937Part18 = Instance.new("Part")
938SpecialMesh19 = Instance.new("SpecialMesh")
939Sound20 = Instance.new("Sound")
940Fire21 = Instance.new("Fire")
941SpotLight22 = Instance.new("SpotLight")
942Sound23 = Instance.new("Sound")
943Sound24 = Instance.new("Sound")
944Tool0.Name = "M16A4"
945Tool0.Parent = mas
946Tool0.GripForward = Vector3.new(-0.557080328, 0.830272019, 0.0176041722)
947Tool0.GripPos = Vector3.new(0.522869527, 0.728810668, -0.409638792)
948Tool0.GripRight = Vector3.new(0.830048621, 0.556014359, 0.0432098135)
949Tool0.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
950Tool0.CanBeDropped = false
951ScreenGui1.Name = "WeaponHud"
952ScreenGui1.Parent = Tool0
953Frame2.Name = "Crosshair"
954Frame2.Parent = ScreenGui1
955Frame2.Transparency = 1
956Frame2.Size = UDim2.new(0, 150, 0, 150)
957Frame2.Position = UDim2.new(0, 500, 0, 500)
958Frame2.Visible = false
959Frame2.BackgroundColor3 = Color3.new(0, 1, 0)
960Frame2.BackgroundTransparency = 1
961Frame2.BorderSizePixel = 0
962Frame3.Name = "TopFrame"
963Frame3.Parent = Frame2
964Frame3.Size = UDim2.new(0, 2, 0, 14)
965Frame3.Position = UDim2.new(0, -1, -0.5, -7)
966Frame3.BackgroundColor3 = Color3.new(0, 0, 0)
967Frame3.BorderColor3 = Color3.new(0, 1, 0)
968Frame4.Name = "BottomFrame"
969Frame4.Parent = Frame2
970Frame4.Size = UDim2.new(0, 2, 0, 14)
971Frame4.Position = UDim2.new(0, -1, 0.5, -7)
972Frame4.BackgroundColor3 = Color3.new(0, 0, 0)
973Frame4.BorderColor3 = Color3.new(0, 1, 0)
974Frame5.Name = "RightFrame"
975Frame5.Parent = Frame2
976Frame5.Size = UDim2.new(0, 14, 0, 2)
977Frame5.Position = UDim2.new(0.5, -7, 0, -1)
978Frame5.BackgroundColor3 = Color3.new(0, 0, 0)
979Frame5.BorderColor3 = Color3.new(0, 1, 0)
980Frame6.Name = "LeftFrame"
981Frame6.Parent = Frame2
982Frame6.Size = UDim2.new(0, 14, 0, 2)
983Frame6.Position = UDim2.new(-0.5, -7, 0, -1)
984Frame6.BackgroundColor3 = Color3.new(0, 0, 0)
985Frame6.BorderColor3 = Color3.new(0, 1, 0)
986ImageLabel7.Name = "TargetHitImage"
987ImageLabel7.Parent = Frame2
988ImageLabel7.Transparency = 1
989ImageLabel7.Size = UDim2.new(0, 50, 0, 50)
990ImageLabel7.Position = UDim2.new(0, -25, 0, -25)
991ImageLabel7.Visible = false
992ImageLabel7.BackgroundTransparency = 1
993ImageLabel7.BorderSizePixel = 0
994ImageLabel7.Image = "http://www.roblox.com/asset/?id=69368028"
995TextLabel8.Name = "ReloadingLabel"
996TextLabel8.Parent = Frame2
997TextLabel8.Transparency = 1
998TextLabel8.Text = "Reloading"
999TextLabel8.Position = UDim2.new(0, 20, 0, -20)
1000TextLabel8.Visible = false
1001TextLabel8.BackgroundTransparency = 1
1002TextLabel8.BorderSizePixel = 0
1003TextLabel8.Font = Enum.Font.ArialBold
1004TextLabel8.FontSize = Enum.FontSize.Size18
1005TextLabel8.TextColor3 = Color3.new(0, 0, 0)
1006TextLabel8.TextStrokeColor3 = Color3.new(0, 1, 0)
1007TextLabel8.TextStrokeTransparency = 0
1008TextLabel8.TextXAlignment = Enum.TextXAlignment.Left
1009TextLabel8.TextYAlignment = Enum.TextYAlignment.Bottom
1010Frame9.Name = "AmmoHud"
1011Frame9.Parent = ScreenGui1
1012Frame9.Transparency = 1
1013Frame9.Size = UDim2.new(0, 200, 0, 50)
1014Frame9.Position = UDim2.new(1, -265, 1, -60)
1015Frame9.BackgroundTransparency = 1
1016Frame9.BorderSizePixel = 0
1017TextLabel10.Name = "ForwardSlash"
1018TextLabel10.Parent = Frame9
1019TextLabel10.Transparency = 0
1020TextLabel10.Text = "/"
1021TextLabel10.Position = UDim2.new(0.5, 0, 0.5, 0)
1022TextLabel10.BackgroundTransparency = 1
1023TextLabel10.BorderSizePixel = 0
1024TextLabel10.Font = Enum.Font.Arial
1025TextLabel10.FontSize = Enum.FontSize.Size48
1026TextLabel10.TextColor3 = Color3.new(1, 1, 1)
1027TextLabel11.Name = "ClipAmmo"
1028TextLabel11.Parent = Frame9
1029TextLabel11.Transparency = 0
1030TextLabel11.Text = "54"
1031TextLabel11.Position = UDim2.new(0.449999988, 0, 0.5, 0)
1032TextLabel11.BackgroundTransparency = 1
1033TextLabel11.BorderSizePixel = 0
1034TextLabel11.Font = Enum.Font.Arial
1035TextLabel11.FontSize = Enum.FontSize.Size48
1036TextLabel11.TextColor3 = Color3.new(1, 1, 1)
1037TextLabel11.TextXAlignment = Enum.TextXAlignment.Right
1038TextLabel12.Name = "TotalAmmo"
1039TextLabel12.Parent = Frame9
1040TextLabel12.Transparency = 0
1041TextLabel12.Text = "180"
1042TextLabel12.Position = UDim2.new(0.550000012, 0, 0.5, 0)
1043TextLabel12.BackgroundTransparency = 1
1044TextLabel12.BorderSizePixel = 0
1045TextLabel12.Font = Enum.Font.Arial
1046TextLabel12.FontSize = Enum.FontSize.Size48
1047TextLabel12.TextColor3 = Color3.new(1, 1, 1)
1048TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
1049LocalScript13.Name = "AssaultRifleScript"
1050LocalScript13.Parent = Tool0
1051table.insert(cors,sandbox(LocalScript13,function()
1052--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
1053-- Waits for the child of the specified parent
1054local function WaitForChild(parent, childName)
1055 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
1056 return parent[childName]
1057end
1058
1059----- MAGIC NUMBERS ABOUT THE TOOL -----
1060-- How much damage a bullet does
1061local Damage = 27
1062local HeadMultiplier = 1.65
1063-- How many times per second the gun can fire
1064local FireRate = 0.095
1065-- The maximum distance the can can shoot, this value should never go above 1000
1066local Range = 400
1067-- In radians the minimum accuracy penalty
1068local MinSpread = 0.01
1069-- In radian the maximum accuracy penalty
1070local MaxSpread = 0.1
1071-- Number of bullets in a clip
1072local ClipSize = 30
1073-- DefaultValue for spare ammo
1074local SpareAmmo = 600
1075-- The amount the aim will increase or decrease by
1076-- decreases this number reduces the speed that recoil takes effect
1077local AimInaccuracyStepAmount = 0.0125
1078-- Time it takes to reload weapon
1079local ReloadTime = 2.5
1080----------------------------------------
1081
1082-- Colors
1083local FriendlyReticleColor = Color3.new(0, 1, 0)
1084local EnemyReticleColor = Color3.new(1, 0, 0)
1085local NeutralReticleColor = Color3.new(1, 1, 1)
1086
1087local Spread = MinSpread
1088local AmmoInClip = ClipSize
1089
1090local Tool = script.Parent
1091local Handle = WaitForChild(Tool, 'Handle')
1092local WeaponGui = nil
1093
1094local LeftButtonDown
1095local Reloading = false
1096local IsShooting = false
1097
1098-- Player specific convenience variables
1099local MyPlayer = nil
1100local MyCharacter = nil
1101local MyHumanoid = nil
1102local MyTorso = nil
1103local MyMouse = nil
1104
1105local RecoilAnim
1106local RecoilTrack = nil
1107
1108local IconURL = Tool.TextureId -- URL to the weapon icon asset
1109
1110local DebrisService = game:GetService('Debris')
1111local PlayersService = game:GetService('Players')
1112
1113
1114local FireSound
1115
1116local OnFireConnection = nil
1117local OnReloadConnection = nil
1118
1119local DecreasedAimLastShot = false
1120local LastSpreadUpdate = time()
1121
1122-- this is a dummy object that holds the flash made when the gun is fired
1123local FlashHolder = nil
1124
1125
1126local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
1127local GetCellFunction = Workspace.Terrain.GetCell
1128
1129function RayIgnoreCheck(hit, pos)
1130 if hit then
1131 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
1132 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
1133 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
1134 return true
1135 elseif hit:IsA('Terrain') and pos then
1136 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
1137 if cellPos then
1138 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
1139 if cellMat and cellMat == Enum.CellMaterial.Water then
1140 return true
1141 end
1142 end
1143 end
1144 end
1145 return false
1146end
1147
1148-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
1149function RayCast(startPos, vec, rayLength)
1150 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
1151 if hitObject and hitPos then
1152 local distance = rayLength - (hitPos - startPos).magnitude
1153 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
1154 -- there is a chance here for potential infinite recursion
1155 return RayCast(hitPos, vec, distance)
1156 end
1157 end
1158 return hitObject, hitPos
1159end
1160
1161
1162
1163function TagHumanoid(humanoid, player)
1164 -- Add more tags here to customize what tags are available.
1165 while humanoid:FindFirstChild('creator') do
1166 humanoid:FindFirstChild('creator'):Destroy()
1167 end
1168 local creatorTag = Instance.new("ObjectValue")
1169 creatorTag.Value = player
1170 creatorTag.Name = "creator"
1171 creatorTag.Parent = humanoid
1172 DebrisService:AddItem(creatorTag, 1.5)
1173
1174 local weaponIconTag = Instance.new("StringValue")
1175 weaponIconTag.Value = IconURL
1176 weaponIconTag.Name = "icon"
1177 weaponIconTag.Parent = creatorTag
1178end
1179
1180local function CreateFlash()
1181 Handle.Light.Enabled = true
1182 delay(0.01, function()
1183 Handle.Light.Enabled = false
1184 end)
1185 if FlashHolder then
1186 if not flash then
1187 flash = Instance.new('Fire', FlashHolder)
1188 flash.Color = Color3.new(1, 140 / 255, 0)
1189 flash.SecondaryColor = Color3.new(1, 0, 0)
1190 flash.Heat = 0
1191 flash.Size = 0.3
1192 delay(0.02, function()
1193 flash.Enabled = false
1194 end)
1195 else
1196 flash.Enabled = true
1197 delay(0.02, function()
1198 flash.Enabled = false
1199 end)
1200 end
1201 else
1202 FlashHolder = Instance.new("Part", Tool)
1203 FlashHolder.Transparency = 1
1204 FlashHolder.CanCollide= false
1205 FlashHolder.Size = Vector3.new(1, 1, 1)
1206 FlashHolder.Position = Tool.Handle.Position
1207 local Weld = Instance.new("ManualWeld")
1208 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
1209 Weld.C1 = CFrame.new(0, 2.2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
1210 Weld.Part0 = FlashHolder
1211 Weld.Part1 = Tool.Handle
1212 Weld.Parent = FlashHolder
1213 end
1214end
1215
1216local function CreateBullet(bulletPos)
1217 local bullet = Instance.new('Part', Workspace)
1218 bullet.FormFactor = Enum.FormFactor.Custom
1219 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
1220 bullet.BrickColor = BrickColor.new("Really black")
1221 bullet.Material = "Neon"
1222 bullet.Shape = Enum.PartType.Ball
1223 bullet.CanCollide = false
1224 bullet.CFrame = CFrame.new(bulletPos)
1225 bullet.Anchored = true
1226 bullet.TopSurface = Enum.SurfaceType.Smooth
1227 bullet.BottomSurface = Enum.SurfaceType.Smooth
1228 bullet.Name = 'Bullet'
1229 DebrisService:AddItem(bullet, 2.5)
1230 --[[local fire = Instance.new("Fire", bullet)
1231 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
1232 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
1233 fire.Size = 1
1234 fire.Heat = 0
1235 DebrisService:AddItem(fire, 0.1)]]--
1236 return bullet
1237end
1238
1239local function weldBetween(a, b)
1240 local weld = Instance.new("Weld")
1241 weld.Part0 = a
1242 weld.Part1 = b
1243 weld.C0 = CFrame.new()
1244 weld.C1 = b.CFrame:inverse() * a.CFrame
1245 weld.Parent = a
1246 return weld;
1247end
1248
1249local function Reload()
1250 if not Reloading then
1251 Reloading = true
1252 -- Don't reload if you are already full or have no extra ammo
1253 if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
1254 if RecoilTrack then
1255 RecoilTrack:Stop()
1256 end
1257 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
1258 if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
1259 WeaponGui.Crosshair.ReloadingLabel.Visible = true
1260 end
1261 end
1262
1263 local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
1264 local torso=WaitForChild(Tool.Parent,'Left Arm')
1265 local oldWeld
1266 for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
1267 if i:IsA('Weld') and i.Part1==Tool.Handle then
1268 oldWeld=i
1269 end
1270 end
1271 if not oldWeld then
1272 print('What... no old weld!')
1273 return
1274 end
1275
1276 Handle.Reload:Play()
1277
1278 aniTrack:Play(0,1,2)
1279 delay(0.35, function()
1280 oldWeld.Part1=nil
1281 ChestWeld= weldBetween(torso,Tool.Handle)
1282 end)
1283 wait(ReloadTime)
1284 oldWeld.Part1=Tool.Handle
1285 ChestWeld:Destroy()
1286 ChestWeld=nil
1287 -- Only use as much ammo as you have
1288 local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
1289 AmmoInClip = AmmoInClip + ammoToUse
1290 SpareAmmo = SpareAmmo - ammoToUse
1291 UpdateAmmo(AmmoInClip)
1292 end
1293 Reloading = false
1294 end
1295end
1296
1297function OnFire()
1298 if IsShooting or stance == true then return end
1299 if MyHumanoid and MyHumanoid.Health > 0 then
1300 IsShooting = true
1301 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
1302 RecoilTrack:Play()
1303 if Spread and not DecreasedAimLastShot then
1304 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
1305 UpdateCrosshair(Spread)
1306 end
1307 DecreasedAimLastShot = not DecreasedAimLastShot
1308 if Handle:FindFirstChild('FireSound') then
1309 Handle.FireSound:Play()
1310 end
1311 CreateFlash()
1312 if MyMouse then
1313 local targetPoint = MyMouse.Hit.p
1314 local shootDirection = (targetPoint - Handle.Position).unit
1315 -- Adjust the shoot direction randomly off by a little bit to account for recoil
1316 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
1317 (0.5 - math.random()) * 2 * Spread,
1318 (0.5 - math.random()) * 2 * Spread) * shootDirection
1319 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
1320 local bullet
1321 -- Create a bullet here
1322 if hitObject then
1323 bullet = CreateBullet(bulletPos)
1324 end
1325 if hitObject and hitObject.Parent then
1326 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
1327 if hitHumanoid then
1328 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
1329 TagHumanoid(hitHumanoid, MyPlayer)
1330 if hitObject.Name == "Head" then
1331 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
1332 else
1333 hitHumanoid:TakeDamage(Damage)
1334 end
1335 if bullet then
1336 bullet:Destroy()
1337 bullet = nil
1338 --bullet.Transparency = 1
1339 end
1340 Spawn(UpdateTargetHit)
1341 end
1342 end
1343
1344 AmmoInClip = AmmoInClip - 1
1345 UpdateAmmo(AmmoInClip)
1346 end
1347 wait(FireRate)
1348 end
1349 IsShooting = false
1350 if AmmoInClip == 0 then
1351 Handle.Empty:Play()
1352 end
1353 if RecoilTrack then
1354 RecoilTrack:Stop()
1355 end
1356 end
1357end
1358
1359local TargetHits = 0
1360function UpdateTargetHit()
1361 TargetHits = TargetHits + 1
1362 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
1363 WeaponGui.Crosshair.TargetHitImage.Visible = true
1364 end
1365 wait(0.5)
1366 TargetHits = TargetHits - 1
1367 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
1368 WeaponGui.Crosshair.TargetHitImage.Visible = false
1369 end
1370end
1371
1372function UpdateCrosshair(value, mouse)
1373 if WeaponGui then
1374 local absoluteY = 650
1375 WeaponGui.Crosshair:TweenSize(
1376 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
1377 Enum.EasingDirection.Out,
1378 Enum.EasingStyle.Linear,
1379 0.33)
1380 end
1381end
1382
1383function UpdateAmmo(value)
1384 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
1385 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
1386 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
1387 WeaponGui.Crosshair.ReloadingLabel.Visible = false
1388 end
1389 end
1390 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
1391 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
1392 end
1393end
1394
1395
1396function OnMouseDown()
1397 LeftButtonDown = true
1398 OnFire()
1399end
1400
1401function OnMouseUp()
1402 LeftButtonDown = false
1403end
1404
1405function safety()
1406 if stance == false then
1407 stance = true
1408 Tool.Enabled = false
1409 passive:Play()
1410 else
1411 stance = false
1412 Tool.Enabled = true
1413 if passive then
1414 passive:Stop()
1415 end
1416 end
1417end
1418
1419function OnKeyDown(key)
1420 if string.lower(key) == 'r' then
1421 Reload()
1422 end
1423 if string.lower(key) == 'q' then
1424 safety()
1425 end
1426end
1427
1428
1429function OnEquipped(mouse)
1430 RecoilAnim = WaitForChild(Tool, 'FireAni')
1431 FireSound = WaitForChild(Handle, 'FireSound')
1432
1433 MyCharacter = Tool.Parent
1434 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
1435 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
1436 MyTorso = MyCharacter:FindFirstChild('Torso')
1437 MyMouse = mouse
1438 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
1439 if WeaponGui and MyPlayer then
1440 WeaponGui.Parent = MyPlayer.PlayerGui
1441 UpdateAmmo(AmmoInClip)
1442 end
1443 if RecoilAnim then
1444 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
1445 end
1446 idle = MyHumanoid:LoadAnimation(Tool.idle)
1447 idle:Play()
1448 gunidleanim = Instance.new("Animation")
1449 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
1450 passive = MyHumanoid:LoadAnimation(gunidleanim)
1451
1452 stance = false
1453 Tool.Enabled = true
1454
1455 if MyMouse then
1456 -- Disable mouse icon
1457 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
1458 MyMouse.Button1Down:connect(OnMouseDown)
1459 MyMouse.Button1Up:connect(OnMouseUp)
1460 MyMouse.KeyDown:connect(OnKeyDown)
1461 end
1462end
1463
1464
1465-- Unequip logic here
1466function OnUnequipped()
1467 if idle then
1468 idle:Stop()
1469 end
1470 if passive then
1471 passive:Stop()
1472 end
1473 LeftButtonDown = false
1474 Reloading = false
1475 MyCharacter = nil
1476 MyHumanoid = nil
1477 MyTorso = nil
1478 MyPlayer = nil
1479 MyMouse = nil
1480 if OnFireConnection then
1481 OnFireConnection:disconnect()
1482 end
1483 if OnReloadConnection then
1484 OnReloadConnection:disconnect()
1485 end
1486 if FlashHolder then
1487 FlashHolder = nil
1488 end
1489 if WeaponGui then
1490 WeaponGui.Parent = nil
1491 WeaponGui = nil
1492 end
1493 if RecoilTrack then
1494 RecoilTrack:Stop()
1495 end
1496end
1497
1498local function SetReticleColor(color)
1499 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
1500 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
1501 if line:IsA('Frame') then
1502 line.BorderColor3 = color
1503 end
1504 end
1505 end
1506end
1507
1508
1509Tool.Equipped:connect(OnEquipped)
1510Tool.Unequipped:connect(OnUnequipped)
1511
1512while true do
1513 wait(0.033)
1514 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
1515 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
1516 SetReticleColor(NeutralReticleColor)
1517
1518 local target = MyMouse.Target
1519 if target and target.Parent then
1520 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
1521 if player then
1522 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
1523 SetReticleColor(EnemyReticleColor)
1524 else
1525 SetReticleColor(FriendlyReticleColor)
1526 end
1527 end
1528 end
1529 end
1530 if Spread and not IsShooting then
1531 local currTime = time()
1532 if currTime - LastSpreadUpdate > FireRate * 2 then
1533 LastSpreadUpdate = currTime
1534 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
1535 UpdateCrosshair(Spread, MyMouse)
1536 end
1537 end
1538end
1539
1540end))
1541Animation14.Name = "FireAni"
1542Animation14.Parent = Tool0
1543Animation14.AnimationId = "rbxassetid://95390146"
1544Animation15.Name = "Reload"
1545Animation15.Parent = Tool0
1546Animation15.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
1547Animation16.Name = "idle"
1548Animation16.Parent = Tool0
1549Animation16.AnimationId = "rbxassetid://95389685"
1550LocalScript17.Name = "CameraMoveDev"
1551LocalScript17.Parent = Tool0
1552table.insert(cors,sandbox(LocalScript17,function()
1553wait()
1554local RunService = game:GetService('RunService')
1555local player = game.Players.LocalPlayer
1556local mouse = player:GetMouse()
1557repeat wait() until player.Character
1558repeat wait() until player.Character:FindFirstChild("Humanoid")
1559repeat wait() until player.Character:FindFirstChild("Torso")
1560local character = player.Character
1561local humanoid = character:WaitForChild("Humanoid")
1562torso = character.Torso
1563keyhold = false
1564--player.CameraMinZoomDistance = 0.5
1565lighting = true
1566haslight = false
1567
1568mouse.KeyDown:connect(function(key)
1569 if key == "f" then
1570 game:GetService("Chat"):Chat(player.Character.Head, "FBI OPEN UP", Enum.ChatColor.Red)
1571 snd = Instance.new("Sound", player.Character.Head)
1572 snd.SoundId = "http://www.roblox.com/asset/?id=1545981804"
1573 snd.EmitterSize = 50
1574 snd.Volume = 10
1575 snd:Play()
1576 delay(0.75, function()
1577 game.Debris:AddItem(snd, snd.TimeLength)
1578 end)
1579 end
1580end)
1581
1582mouse.TargetFilter = nil
1583
1584--humanoid.JumpPower = 0
1585
1586maxcount = 100
1587runcount = maxcount
1588
1589function populateparts(mdl)
1590 if mdl:IsA("BasePart") then
1591 table.insert(parts,mdl)
1592 end
1593 for i2,mdl2 in ipairs(mdl:GetChildren()) do
1594 populateparts(mdl2)
1595 end
1596end
1597
1598function weldBetween(a, b)
1599 --Make a new Weld and Parent it to a.
1600 weld = Instance.new("ManualWeld", a)
1601 --Get the CFrame of b relative to a.
1602 weld.C0 = a.CFrame:inverse() * b.CFrame
1603 --Set the Part0 and Part1 properties respectively
1604 weld.Part0 = a
1605 weld.Part1 = b
1606 --Return the reference to the weld so that you can change it later.
1607 return weld
1608end
1609
1610humanoid.Died:connect(function()
1611 if armgroup then
1612 armgroup:Destroy()
1613 if cl then
1614 cl:Destroy()
1615 end
1616 if cl2 then
1617 cl2:Destroy()
1618 end
1619 end
1620end)
1621
1622LocalObjects = {}
1623function SetLocalTransparency(Table)
1624 for i, v in pairs(LocalObjects) do
1625 if v.Object == Table.Object then
1626 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
1627 table.remove(LocalObjects, i)
1628 end
1629 end
1630 if not Table.Transparency then
1631 return
1632 end
1633 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
1634 table.insert(LocalObjects, Table)
1635 if ModifyTransparency then
1636 ModifyTransparency:disconnect()
1637 end
1638 ModifyTransparency = RunService.RenderStepped:connect(function()
1639 for i, v in pairs(LocalObjects) do
1640 if v.Object and v.Object.Parent then
1641 local CurrentTransparency = v.Object.LocalTransparencyModifier
1642 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
1643 v.Object.LocalTransparencyModifier = v.Transparency
1644 end
1645 else
1646 table.remove(LocalObjects, i)
1647 end
1648 end
1649 end)
1650end
1651
1652local function SetupJoints()
1653 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
1654 return -- TODO: Make tracking compatible with R15
1655 end
1656 torso = character:FindFirstChild("Torso")
1657
1658 Neck = torso.Neck
1659 OldNeckC0 = Neck.C0
1660 OldNeckC1 = Neck.C1
1661 Shoulder = torso['Right Shoulder']
1662 Shoulder2 = torso['Left Shoulder']
1663 OldShoulderC0 = Shoulder.C0
1664 OldShoulderC1 = Shoulder.C1
1665 OldShoulder2C0 = Shoulder2.C0
1666 OldShoulder2C1 = Shoulder2.C1
1667end
1668
1669local function visual()
1670 if Tool then
1671 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
1672 Color = Instance.new("ColorCorrectionEffect")
1673 Color.Name = "KillColor"
1674 Color.Saturation = -0.5
1675 Color.Parent = game.Workspace.CurrentCamera
1676 game.Debris:AddItem(Color, 0.22)
1677 Blur = Instance.new("BlurEffect")
1678 Blur.Name = "KillBlur"
1679 Blur.Size = 8
1680 Blur.Parent = game.Workspace.CurrentCamera
1681 game.Debris:AddItem(Blur, 0.22)
1682 Tool.GetKill:Destroy()
1683 end
1684
1685 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
1686 Color = Instance.new("ColorCorrectionEffect")
1687 Color.Name = "KillColor"
1688 Color.Saturation = -0.75
1689 Color.TintColor = Color3.new(1, 0.9, 0.9)
1690 Color.Parent = game.Workspace.CurrentCamera
1691 game.Debris:AddItem(Color, 0.22)
1692 Blur = Instance.new("BlurEffect")
1693 Blur.Name = "KillBlur"
1694 Blur.Size = 8
1695 Blur.Parent = game.Workspace.CurrentCamera
1696 game.Debris:AddItem(Blur, 0.22)
1697 Tool.GetHeadKill:Destroy()
1698 end
1699 end
1700
1701 --player.CameraMode = Enum.CameraMode.LockFirstPerson
1702
1703end
1704
1705SetupJoints()
1706
1707game:GetService("RunService").RenderStepped:connect(function()
1708 if character and humanoid.Health > 0 and script.Parent.Parent == character then
1709 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
1710 Tool = character:FindFirstChildOfClass("Tool")
1711 visual()
1712 else
1713 Tool = nil
1714 end
1715 if Tool and Tool.Enabled == true then
1716 character.Humanoid.AutoRotate = false
1717
1718 mouse.TargetFilter = game.Workspace
1719 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
1720 --game.Workspace.CurrentCamera.CameraSubject = character.Head
1721 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
1722 --end
1723
1724 character['Torso'].Neck.C0 = OldNeckC0
1725 character['Torso'].Neck.C1 = OldNeckC1
1726 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1727 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1728 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1729 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1730
1731 local toMouse = (mouse.Hit.p - character.Head.Position).unit
1732 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
1733 local neckAngle = angle
1734 if math.deg(neckAngle) > 110 then
1735 neckAngle = math.rad(110)
1736 end
1737
1738 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
1739
1740 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
1741 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
1742
1743 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
1744 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
1745 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
1746 end
1747 else
1748 if armgroup then
1749 armgroup:Destroy()
1750 armgroup = nil
1751 end
1752 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
1753 character['Torso'].Neck.C0 = OldNeckC0
1754 character['Torso'].Neck.C1 = OldNeckC1
1755 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1756 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1757 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1758 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1759
1760 character.Humanoid.AutoRotate = true
1761 mouse.TargetFilter = nil
1762
1763 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
1764 for i, v in pairs(character:GetChildren()) do
1765 if v:IsA("BasePart") then
1766 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
1767 end
1768 if v:IsA("Accessory") then
1769 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
1770 end
1771 end
1772 end
1773 end
1774 end
1775end)
1776
1777script.Parent.Unequipped:connect(function()
1778 if armgroup then
1779 armgroup:Destroy()
1780 armgroup = nil
1781 end
1782 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
1783 character['Torso'].Neck.C0 = OldNeckC0
1784 character['Torso'].Neck.C1 = OldNeckC1
1785 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1786 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1787 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1788 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1789
1790 character.Humanoid.AutoRotate = true
1791 mouse.TargetFilter = nil
1792
1793 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
1794 for i, v in pairs(character:GetChildren()) do
1795 if v:IsA("BasePart") then
1796 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
1797 end
1798 if v:IsA("Accessory") then
1799 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
1800 end
1801 end
1802 end
1803end)
1804end))
1805Part18.Name = "Handle"
1806Part18.Parent = Tool0
1807Part18.BrickColor = BrickColor.new("Black")
1808Part18.Rotation = Vector3.new(-90, 0, -90)
1809Part18.FormFactor = Enum.FormFactor.Custom
1810Part18.Size = Vector3.new(0.400000006, 3.4000001, 0.800000012)
1811Part18.CFrame = CFrame.new(33.7200012, 9.61999989, 41.6899986, 0, 1, 0, 0, 0, 1, 1, 0, 0)
1812Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
1813Part18.Position = Vector3.new(33.7200012, 9.61999989, 41.6899986)
1814Part18.Orientation = Vector3.new(-90, -90, 0)
1815Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
1816SpecialMesh19.Parent = Part18
1817SpecialMesh19.MeshId = "http://www.roblox.com/asset/?id=72012671"
1818SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
1819SpecialMesh19.TextureId = "http://www.roblox.com/asset/?id=72012605"
1820SpecialMesh19.VertexColor = Vector3.new(2, 2, 2)
1821SpecialMesh19.MeshType = Enum.MeshType.FileMesh
1822SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
1823Sound20.Name = "FireSound"
1824Sound20.Parent = Part18
1825Sound20.SoundId = "rbxassetid://151997297"
1826Sound20.Volume = 1
1827Fire21.Parent = Part18
1828Fire21.Size = 2
1829Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
1830Fire21.Enabled = false
1831Fire21.Heat = 0
1832Fire21.SecondaryColor = Color3.new(0, 0, 0)
1833Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
1834SpotLight22.Name = "Light"
1835SpotLight22.Parent = Part18
1836SpotLight22.Color = Color3.new(1, 1, 0.498039)
1837SpotLight22.Enabled = false
1838SpotLight22.Brightness = 50
1839SpotLight22.Range = 18
1840SpotLight22.Angle = 120
1841SpotLight22.Face = Enum.NormalId.Top
1842SpotLight22.Color = Color3.new(1, 1, 0.498039)
1843Sound23.Name = "Reload"
1844Sound23.Parent = Part18
1845Sound23.SoundId = "http://www.roblox.com/asset/?id=95309699"
1846Sound23.Volume = 1
1847Sound24.Name = "Empty"
1848Sound24.Parent = Part18
1849Sound24.SoundId = "rbxassetid://240785604"
1850Sound24.Volume = 1
1851for i,v in pairs(mas:GetChildren()) do
1852 v.Parent = game:GetService("Players").LocalPlayer.Backpack
1853 pcall(function() v:MakeJoints() end)
1854end
1855mas:Destroy()
1856for i,v in pairs(cors) do
1857 spawn(function()
1858 pcall(v)
1859 end)
1860end
1861
1862--Converted with ttyyuu12345's model to script plugin v4
1863function sandbox(var,func)
1864 local env = getfenv(func)
1865 local newenv = setmetatable({},{
1866 __index = function(self,k)
1867 if k=="script" then
1868 return var
1869 else
1870 return env[k]
1871 end
1872 end,
1873 })
1874 setfenv(func,newenv)
1875 return func
1876end
1877cors = {}
1878mas = Instance.new("Model",game:GetService("Lighting"))
1879Tool0 = Instance.new("Tool")
1880Part1p = Instance.new("Part")
1881SpecialMesh2 = Instance.new("SpecialMesh")
1882LocalScript3 = Instance.new("LocalScript")
1883Tool4 = Instance.new("Tool")
1884ScreenGui5 = Instance.new("ScreenGui")
1885Frame6 = Instance.new("Frame")
1886Frame7 = Instance.new("Frame")
1887Frame8 = Instance.new("Frame")
1888Frame9 = Instance.new("Frame")
1889Frame10 = Instance.new("Frame")
1890ImageLabel11 = Instance.new("ImageLabel")
1891TextLabel12 = Instance.new("TextLabel")
1892Frame13 = Instance.new("Frame")
1893TextLabel14 = Instance.new("TextLabel")
1894TextLabel15 = Instance.new("TextLabel")
1895TextLabel16 = Instance.new("TextLabel")
1896LocalScript17 = Instance.new("LocalScript")
1897Animation18 = Instance.new("Animation")
1898LocalScript19 = Instance.new("LocalScript")
1899Part20 = Instance.new("Part")
1900SpecialMesh21 = Instance.new("SpecialMesh")
1901Sound22 = Instance.new("Sound")
1902Sound23 = Instance.new("Sound")
1903Sound24 = Instance.new("Sound")
1904Fire25 = Instance.new("Fire")
1905SpotLight26 = Instance.new("SpotLight")
1906Animation27 = Instance.new("Animation")
1907Animation28 = Instance.new("Animation")
1908Tool29 = Instance.new("Tool")
1909LocalScript30 = Instance.new("LocalScript")
1910Script31 = Instance.new("Script")
1911Part32 = Instance.new("Part")
1912CylinderMesh33 = Instance.new("CylinderMesh")
1913Weld34 = Instance.new("Weld")
1914Sound35 = Instance.new("Sound")
1915Sound36 = Instance.new("Sound")
1916Sound37 = Instance.new("Sound")
1917Sound38 = Instance.new("Sound")
1918Sound39 = Instance.new("Sound")
1919Part40 = Instance.new("Part")
1920CylinderMesh41 = Instance.new("CylinderMesh")
1921Weld42 = Instance.new("Weld")
1922Script43 = Instance.new("Script")
1923Part44 = Instance.new("Part")
1924CylinderMesh45 = Instance.new("CylinderMesh")
1925Weld46 = Instance.new("Weld")
1926Script47 = Instance.new("Script")
1927Part48 = Instance.new("Part")
1928CylinderMesh49 = Instance.new("CylinderMesh")
1929Script50 = Instance.new("Script")
1930BoolValue51 = Instance.new("BoolValue")
1931BoolValue52 = Instance.new("BoolValue")
1932BoolValue53 = Instance.new("BoolValue")
1933Script54 = Instance.new("Script")
1934LocalScript55 = Instance.new("LocalScript")
1935Animation56 = Instance.new("Animation")
1936Animation57 = Instance.new("Animation")
1937Animation58 = Instance.new("Animation")
1938Animation59 = Instance.new("Animation")
1939Animation60 = Instance.new("Animation")
1940Animation61 = Instance.new("Animation")
1941Tool62 = Instance.new("Tool")
1942Part63 = Instance.new("Part")
1943SpecialMesh64 = Instance.new("SpecialMesh")
1944Sound65 = Instance.new("Sound")
1945Sound66 = Instance.new("Sound")
1946LocalScript67 = Instance.new("LocalScript")
1947Script68 = Instance.new("Script")
1948Sound69 = Instance.new("Sound")
1949Sound70 = Instance.new("Sound")
1950Script71 = Instance.new("Script")
1951LocalScript72 = Instance.new("LocalScript")
1952Animation73 = Instance.new("Animation")
1953LocalScript74 = Instance.new("LocalScript")
1954Part75 = Instance.new("Part")
1955SpecialMesh76 = Instance.new("SpecialMesh")
1956Script77 = Instance.new("Script")
1957Script78 = Instance.new("Script")
1958LocalScript79 = Instance.new("LocalScript")
1959LocalScript80 = Instance.new("LocalScript")
1960Tool81 = Instance.new("Tool")
1961Part82 = Instance.new("Part")
1962BlockMesh83 = Instance.new("BlockMesh")
1963Part84 = Instance.new("Part")
1964BlockMesh85 = Instance.new("BlockMesh")
1965Script86 = Instance.new("Script")
1966LocalScript87 = Instance.new("LocalScript")
1967Part88 = Instance.new("Part")
1968CylinderMesh89 = Instance.new("CylinderMesh")
1969Part90 = Instance.new("Part")
1970BlockMesh91 = Instance.new("BlockMesh")
1971Part92 = Instance.new("Part")
1972SpecialMesh93 = Instance.new("SpecialMesh")
1973Part94 = Instance.new("Part")
1974BlockMesh95 = Instance.new("BlockMesh")
1975Part96 = Instance.new("Part")
1976BlockMesh97 = Instance.new("BlockMesh")
1977Part98 = Instance.new("Part")
1978BlockMesh99 = Instance.new("BlockMesh")
1979Part100 = Instance.new("Part")
1980BlockMesh101 = Instance.new("BlockMesh")
1981Part102 = Instance.new("Part")
1982SpecialMesh103 = Instance.new("SpecialMesh")
1983Part104 = Instance.new("Part")
1984BlockMesh105 = Instance.new("BlockMesh")
1985Part106 = Instance.new("Part")
1986BlockMesh107 = Instance.new("BlockMesh")
1987Part108 = Instance.new("Part")
1988BlockMesh109 = Instance.new("BlockMesh")
1989Part110 = Instance.new("Part")
1990BlockMesh111 = Instance.new("BlockMesh")
1991Part112 = Instance.new("Part")
1992BlockMesh113 = Instance.new("BlockMesh")
1993Part114 = Instance.new("Part")
1994BlockMesh115 = Instance.new("BlockMesh")
1995Part116 = Instance.new("Part")
1996SpecialMesh117 = Instance.new("SpecialMesh")
1997Part118 = Instance.new("Part")
1998BlockMesh119 = Instance.new("BlockMesh")
1999Part120 = Instance.new("Part")
2000BlockMesh121 = Instance.new("BlockMesh")
2001Part122 = Instance.new("Part")
2002BlockMesh123 = Instance.new("BlockMesh")
2003Part124 = Instance.new("Part")
2004BlockMesh125 = Instance.new("BlockMesh")
2005Part126 = Instance.new("Part")
2006BlockMesh127 = Instance.new("BlockMesh")
2007Decal128 = Instance.new("Decal")
2008Part129 = Instance.new("Part")
2009BlockMesh130 = Instance.new("BlockMesh")
2010Part131 = Instance.new("Part")
2011CylinderMesh132 = Instance.new("CylinderMesh")
2012Part133 = Instance.new("Part")
2013BlockMesh134 = Instance.new("BlockMesh")
2014Part135 = Instance.new("Part")
2015BlockMesh136 = Instance.new("BlockMesh")
2016Part137 = Instance.new("Part")
2017BlockMesh138 = Instance.new("BlockMesh")
2018Part139 = Instance.new("Part")
2019BlockMesh140 = Instance.new("BlockMesh")
2020Part141 = Instance.new("Part")
2021BlockMesh142 = Instance.new("BlockMesh")
2022Part143 = Instance.new("Part")
2023BlockMesh144 = Instance.new("BlockMesh")
2024Part145 = Instance.new("Part")
2025BlockMesh146 = Instance.new("BlockMesh")
2026Part147 = Instance.new("Part")
2027BlockMesh148 = Instance.new("BlockMesh")
2028Part149 = Instance.new("Part")
2029BlockMesh150 = Instance.new("BlockMesh")
2030Part151 = Instance.new("Part")
2031BlockMesh152 = Instance.new("BlockMesh")
2032Part153 = Instance.new("Part")
2033BlockMesh154 = Instance.new("BlockMesh")
2034Part155 = Instance.new("Part")
2035BlockMesh156 = Instance.new("BlockMesh")
2036Part157 = Instance.new("Part")
2037BlockMesh158 = Instance.new("BlockMesh")
2038Part159 = Instance.new("Part")
2039SpecialMesh160 = Instance.new("SpecialMesh")
2040Part161 = Instance.new("Part")
2041BlockMesh162 = Instance.new("BlockMesh")
2042Part163 = Instance.new("Part")
2043BlockMesh164 = Instance.new("BlockMesh")
2044Part165 = Instance.new("Part")
2045BlockMesh166 = Instance.new("BlockMesh")
2046Part167 = Instance.new("Part")
2047BlockMesh168 = Instance.new("BlockMesh")
2048Part169 = Instance.new("Part")
2049BlockMesh170 = Instance.new("BlockMesh")
2050Part171 = Instance.new("Part")
2051BlockMesh172 = Instance.new("BlockMesh")
2052Sound173 = Instance.new("Sound")
2053Sound174 = Instance.new("Sound")
2054Sound175 = Instance.new("Sound")
2055Tool4.Parent = mas
2056Tool0.Name = "Handcuffs"
2057Tool0.Parent = mas
2058Tool0.GripForward = Vector3.new(-0.77155745, 0.462976098, 0.43629396)
2059Tool0.GripPos = Vector3.new(0.899999976, 0.5, 0.400000006)
2060Tool0.GripRight = Vector3.new(0.632408082, 0.63257581, 0.447110623)
2061Tool0.GripUp = Vector3.new(0.0689874813, -0.620887339, 0.780858338)
2062Tool0.CanBeDropped = false
2063Part1p.Name = "Handle"
2064Part1p.Parent = Tool0
2065Part1p.FormFactor = Enum.FormFactor.Custom
2066Part1p.Size = Vector3.new(2, 2, 2)
2067Part1p.CFrame = CFrame.new(0.880016029, 2.99999905, 6.64000177, 1, 0, 0, 0, 1, 0, 0, 0, 1)
2068Part1p.Position = Vector3.new(0.880016029, 2.99999905, 6.64000177)
2069SpecialMesh2.Parent = Part1p
2070SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=88046657"
2071SpecialMesh2.Scale = Vector3.new(2, 2, 2)
2072SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=88046679"
2073SpecialMesh2.MeshType = Enum.MeshType.FileMesh
2074SpecialMesh2.Scale = Vector3.new(2, 2, 2)
2075LocalScript3.Parent = Tool0
2076table.insert(cors,sandbox(LocalScript3,function()
2077script.Parent.Equipped:connect(function(m)
2078m.Button1Down:connect(function()
2079if m.Target~=nil then
2080print(m.Target:GetFullName())
2081p=nil
2082_,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
2083print(p)
2084print(m.Target.Parent.Name)
2085if p~=nil then
2086local detained=p
2087coroutine.wrap(function()
2088 local c=p
2089 while p==c do wait() pcall(function()
2090 p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
2091 end) end
2092 print('END OF DETAIN LOOP')
2093 pcall(function() c.Character.Torso.Anchored=false end)
2094end)()
2095else print('no p') end
2096end
2097end)
2098end)
2099
2100local Tool = script.Parent
2101local Handle = Tool.Handle
2102local On = false
2103
2104Weld = function(Part0, Part1, C0, C1)
2105 local Weld = Instance.new("Weld")
2106 Weld.Part0 = Part0
2107 Weld.Part1 = Part1
2108 Weld.C0 = C0 or CFrame.new(0, 0, 0)
2109 Weld.C1 = C1 or CFrame.new(0, 0, 0)
2110 Weld.Parent = Part0
2111 return Weld
2112end
2113
2114local rWeld, lWeld
2115local LeftArm, RightArm, Torso, rShoulder, lShoulder
2116
2117Tool.Equipped:connect(function()
2118 On = true
2119 LeftArm = Tool.Parent:FindFirstChild("Left Arm")
2120 RightArm = Tool.Parent:FindFirstChild("Right Arm")
2121 Torso = Tool.Parent:FindFirstChild("Torso")
2122 rShoulder = Torso:FindFirstChild("Right Shoulder")
2123 lShoulder = Torso:FindFirstChild("Left Shoulder")
2124 rShoulder.Part1 = nil
2125 lShoulder.Part1 = nil
2126 rWeld = Weld(Torso, RightArm, CFrame.new(1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,-math.pi/20))
2127 lWeld = Weld(Torso, LeftArm, CFrame.new(-1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,math.pi/20))
2128end)
2129
2130Tool.Unequipped:connect(function()
2131 On = false
2132 rShoulder.Part1 = RightArm
2133 lShoulder.Part1 = LeftArm
2134 rWeld:Destroy()
2135 lWeld:Destroy()
2136end)
2137end))
2138Tool4.Name = "Pistol"
2139Tool4.GripForward = Vector3.new(-0.557080388, 0.830272019, 0.0176041797)
2140Tool4.GripPos = Vector3.new(0.104686491, -0.334273487, -0.409638941)
2141Tool4.GripRight = Vector3.new(0.8300488, 0.556014478, 0.043209821)
2142Tool4.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
2143Tool4.CanBeDropped = false
2144ScreenGui5.Name = "WeaponHud"
2145ScreenGui5.Parent = Tool4
2146Frame6.Name = "Crosshair"
2147Frame6.Parent = ScreenGui5
2148Frame6.Transparency = 1
2149Frame6.Size = UDim2.new(0, 150, 0, 150)
2150Frame6.Position = UDim2.new(0, 500, 0, 500)
2151Frame6.Visible = false
2152Frame6.BackgroundColor3 = Color3.new(0, 1, 0)
2153Frame6.BackgroundTransparency = 1
2154Frame6.BorderSizePixel = 0
2155Frame7.Name = "TopFrame"
2156Frame7.Parent = Frame6
2157Frame7.Size = UDim2.new(0, 2, 0, 14)
2158Frame7.Position = UDim2.new(0, -1, -0.5, -7)
2159Frame7.BackgroundColor3 = Color3.new(0, 0, 0)
2160Frame7.BorderColor3 = Color3.new(0, 1, 0)
2161Frame8.Name = "BottomFrame"
2162Frame8.Parent = Frame6
2163Frame8.Size = UDim2.new(0, 2, 0, 14)
2164Frame8.Position = UDim2.new(0, -1, 0.5, -7)
2165Frame8.BackgroundColor3 = Color3.new(0, 0, 0)
2166Frame8.BorderColor3 = Color3.new(0, 1, 0)
2167Frame9.Name = "RightFrame"
2168Frame9.Parent = Frame6
2169Frame9.Size = UDim2.new(0, 14, 0, 2)
2170Frame9.Position = UDim2.new(0.5, -7, 0, -1)
2171Frame9.BackgroundColor3 = Color3.new(0, 0, 0)
2172Frame9.BorderColor3 = Color3.new(0, 1, 0)
2173Frame10.Name = "LeftFrame"
2174Frame10.Parent = Frame6
2175Frame10.Size = UDim2.new(0, 14, 0, 2)
2176Frame10.Position = UDim2.new(-0.5, -7, 0, -1)
2177Frame10.BackgroundColor3 = Color3.new(0, 0, 0)
2178Frame10.BorderColor3 = Color3.new(0, 1, 0)
2179ImageLabel11.Name = "TargetHitImage"
2180ImageLabel11.Parent = Frame6
2181ImageLabel11.Transparency = 1
2182ImageLabel11.Size = UDim2.new(0, 50, 0, 50)
2183ImageLabel11.Position = UDim2.new(0, -25, 0, -25)
2184ImageLabel11.Visible = false
2185ImageLabel11.BackgroundTransparency = 1
2186ImageLabel11.BorderSizePixel = 0
2187ImageLabel11.Image = "http://www.roblox.com/asset/?id=69368028"
2188TextLabel12.Name = "ReloadingLabel"
2189TextLabel12.Parent = Frame6
2190TextLabel12.Transparency = 1
2191TextLabel12.Text = "Reloading"
2192TextLabel12.Position = UDim2.new(0, 20, 0, -20)
2193TextLabel12.Visible = false
2194TextLabel12.BackgroundTransparency = 1
2195TextLabel12.BorderSizePixel = 0
2196TextLabel12.Font = Enum.Font.ArialBold
2197TextLabel12.FontSize = Enum.FontSize.Size18
2198TextLabel12.TextColor3 = Color3.new(0, 0, 0)
2199TextLabel12.TextStrokeColor3 = Color3.new(0, 1, 0)
2200TextLabel12.TextStrokeTransparency = 0
2201TextLabel12.TextTransparency = 1
2202TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
2203TextLabel12.TextYAlignment = Enum.TextYAlignment.Bottom
2204Frame13.Name = "AmmoHud"
2205Frame13.Parent = ScreenGui5
2206Frame13.Transparency = 1
2207Frame13.Size = UDim2.new(0, 200, 0, 50)
2208Frame13.Position = UDim2.new(1, -265, 1, -60)
2209Frame13.BackgroundTransparency = 1
2210Frame13.BorderSizePixel = 0
2211TextLabel14.Name = "ForwardSlash"
2212TextLabel14.Parent = Frame13
2213TextLabel14.Transparency = 0
2214TextLabel14.Text = "/"
2215TextLabel14.Position = UDim2.new(0.5, 0, 0.5, 0)
2216TextLabel14.BackgroundTransparency = 1
2217TextLabel14.BorderSizePixel = 0
2218TextLabel14.Font = Enum.Font.Arial
2219TextLabel14.FontSize = Enum.FontSize.Size48
2220TextLabel14.TextColor3 = Color3.new(1, 1, 1)
2221TextLabel15.Name = "ClipAmmo"
2222TextLabel15.Parent = Frame13
2223TextLabel15.Transparency = 0
2224TextLabel15.Text = "54"
2225TextLabel15.Position = UDim2.new(0.449999988, 0, 0.5, 0)
2226TextLabel15.BackgroundTransparency = 1
2227TextLabel15.BorderSizePixel = 0
2228TextLabel15.Font = Enum.Font.Arial
2229TextLabel15.FontSize = Enum.FontSize.Size48
2230TextLabel15.TextColor3 = Color3.new(1, 1, 1)
2231TextLabel15.TextXAlignment = Enum.TextXAlignment.Right
2232TextLabel16.Name = "TotalAmmo"
2233TextLabel16.Parent = Frame13
2234TextLabel16.Transparency = 0
2235TextLabel16.Text = "180"
2236TextLabel16.Position = UDim2.new(0.550000012, 0, 0.5, 0)
2237TextLabel16.BackgroundTransparency = 1
2238TextLabel16.BorderSizePixel = 0
2239TextLabel16.Font = Enum.Font.Arial
2240TextLabel16.FontSize = Enum.FontSize.Size48
2241TextLabel16.TextColor3 = Color3.new(1, 1, 1)
2242TextLabel16.TextXAlignment = Enum.TextXAlignment.Left
2243LocalScript17.Name = "AssaultRifleScript"
2244LocalScript17.Parent = Tool4
2245table.insert(cors,sandbox(LocalScript17,function()
2246--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
2247-- Waits for the child of the specified parent
2248local function WaitForChild(parent, childName)
2249 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
2250 return parent[childName]
2251end
2252
2253----- MAGIC NUMBERS ABOUT THE TOOL -----
2254local Auto = false
2255-- How much damage a bullet does
2256local Damage = 65
2257local HeadMultiplier = 1.65
2258-- How many times per second the gun can fire
2259local FireRate = 0.15
2260-- The maximum distance the can can shoot, this value should never go above 1000
2261local Range = 400
2262-- In radians the minimum accuracy penalty
2263local MinSpread = 0.01
2264-- In radian the maximum accuracy penalty
2265local MaxSpread = 0.075
2266-- Number of bullets in a clip
2267local ClipSize = 12
2268-- DefaultValue for spare ammo
2269local SpareAmmo = 240
2270-- The amount the aim will increase or decrease by
2271-- decreases this number reduces the speed that recoil takes effect
2272local AimInaccuracyStepAmount = 0.0125
2273-- Time it takes to reload weapon
2274local ReloadTime = 2.5
2275----------------------------------------
2276
2277-- Colors
2278local FriendlyReticleColor = Color3.new(0, 1, 0)
2279local EnemyReticleColor = Color3.new(1, 0, 0)
2280local NeutralReticleColor = Color3.new(1, 1, 1)
2281
2282local Spread = MinSpread
2283local AmmoInClip = ClipSize
2284
2285local Tool = script.Parent
2286local Handle = WaitForChild(Tool, 'Handle')
2287local WeaponGui = nil
2288
2289local LeftButtonDown
2290local Reloading = false
2291local IsShooting = false
2292
2293-- Player specific convenience variables
2294local MyPlayer = nil
2295local MyCharacter = nil
2296local MyHumanoid = nil
2297local MyTorso = nil
2298local MyMouse = nil
2299
2300local RecoilAnim
2301local RecoilTrack = nil
2302
2303local IconURL = Tool.TextureId -- URL to the weapon icon asset
2304
2305local DebrisService = game:GetService('Debris')
2306local PlayersService = game:GetService('Players')
2307
2308
2309local FireSound
2310
2311local OnFireConnection = nil
2312local OnReloadConnection = nil
2313
2314local DecreasedAimLastShot = false
2315local LastSpreadUpdate = time()
2316
2317-- this is a dummy object that holds the flash made when the gun is fired
2318local FlashHolder = nil
2319
2320
2321local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
2322local GetCellFunction = Workspace.Terrain.GetCell
2323
2324function RayIgnoreCheck(hit, pos)
2325 if hit then
2326 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
2327 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
2328 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
2329 return true
2330 elseif hit:IsA('Terrain') and pos then
2331 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
2332 if cellPos then
2333 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
2334 if cellMat and cellMat == Enum.CellMaterial.Water then
2335 return true
2336 end
2337 end
2338 end
2339 end
2340 return false
2341end
2342
2343-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
2344function RayCast(startPos, vec, rayLength)
2345 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
2346 if hitObject and hitPos then
2347 local distance = rayLength - (hitPos - startPos).magnitude
2348 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
2349 -- there is a chance here for potential infinite recursion
2350 return RayCast(hitPos, vec, distance)
2351 end
2352 end
2353 return hitObject, hitPos
2354end
2355
2356
2357
2358function TagHumanoid(humanoid, player)
2359 -- Add more tags here to customize what tags are available.
2360 while humanoid:FindFirstChild('creator') do
2361 humanoid:FindFirstChild('creator'):Destroy()
2362 end
2363 local creatorTag = Instance.new("ObjectValue")
2364 creatorTag.Value = player
2365 creatorTag.Name = "creator"
2366 creatorTag.Parent = humanoid
2367 DebrisService:AddItem(creatorTag, 1.5)
2368
2369 local weaponIconTag = Instance.new("StringValue")
2370 weaponIconTag.Value = IconURL
2371 weaponIconTag.Name = "icon"
2372 weaponIconTag.Parent = creatorTag
2373end
2374
2375local function CreateFlash()
2376 Handle.Light.Enabled = true
2377 delay(0.01, function()
2378 Handle.Light.Enabled = false
2379 end)
2380 if FlashHolder then
2381 if not flash then
2382 flash = Instance.new('Fire', FlashHolder)
2383 flash.Color = Color3.new(1, 140 / 255, 0)
2384 flash.SecondaryColor = Color3.new(1, 0, 0)
2385 flash.Heat = 0
2386 flash.Size = 0.3
2387 delay(0.02, function()
2388 flash.Enabled = false
2389 end)
2390 else
2391 flash.Enabled = true
2392 delay(0.02, function()
2393 flash.Enabled = false
2394 end)
2395 end
2396 else
2397 FlashHolder = Instance.new("Part", Tool)
2398 FlashHolder.Transparency = 1
2399 FlashHolder.CanCollide= false
2400 FlashHolder.Size = Vector3.new(1, 1, 1)
2401 FlashHolder.Position = Tool.Handle.Position
2402 local Weld = Instance.new("ManualWeld")
2403 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
2404 Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
2405 Weld.Part0 = FlashHolder
2406 Weld.Part1 = Tool.Handle
2407 Weld.Parent = FlashHolder
2408 end
2409end
2410
2411local function CreateBullet(bulletPos)
2412 local bullet = Instance.new('Part', Workspace)
2413 bullet.FormFactor = Enum.FormFactor.Custom
2414 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
2415 bullet.BrickColor = BrickColor.new("Really black")
2416 bullet.Material = "Neon"
2417 bullet.Shape = Enum.PartType.Ball
2418 bullet.CanCollide = false
2419 bullet.CFrame = CFrame.new(bulletPos)
2420 bullet.Anchored = true
2421 bullet.TopSurface = Enum.SurfaceType.Smooth
2422 bullet.BottomSurface = Enum.SurfaceType.Smooth
2423 bullet.Name = 'Bullet'
2424 DebrisService:AddItem(bullet, 2.5)
2425 --[[local fire = Instance.new("Fire", bullet)
2426 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
2427 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
2428 fire.Size = 1
2429 fire.Heat = 0
2430 DebrisService:AddItem(fire, 0.1)]]--
2431 return bullet
2432end
2433
2434local function weldBetween(a, b)
2435 local weld = Instance.new("Weld")
2436 weld.Part0 = a
2437 weld.Part1 = b
2438 weld.C0 = CFrame.new()
2439 weld.C1 = b.CFrame:inverse() * a.CFrame
2440 weld.Parent = a
2441 return weld;
2442end
2443
2444local function Reload()
2445 if not Reloading then
2446 Reloading = true
2447 -- Don't reload if you are already full or have no extra ammo
2448 if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
2449 if RecoilTrack then
2450 RecoilTrack:Stop()
2451 end
2452 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
2453 if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
2454 WeaponGui.Crosshair.ReloadingLabel.Visible = true
2455 end
2456 end
2457
2458 local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
2459 local torso=WaitForChild(Tool.Parent,'Left Arm')
2460 local oldWeld
2461 for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
2462 if i:IsA('Weld') and i.Part1==Tool.Handle then
2463 oldWeld=i
2464 end
2465 end
2466 if not oldWeld then
2467 print('What... no old weld!')
2468 return
2469 end
2470
2471 Handle.Reload:Play()
2472
2473 aniTrack:Play(0,1,2)
2474 delay(0.35, function()
2475 oldWeld.Part1=nil
2476 ChestWeld= weldBetween(torso,Tool.Handle)
2477 end)
2478 wait(ReloadTime)
2479 oldWeld.Part1=Tool.Handle
2480 ChestWeld:Destroy()
2481 ChestWeld=nil
2482 -- Only use as much ammo as you have
2483 local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
2484 AmmoInClip = AmmoInClip + ammoToUse
2485 SpareAmmo = SpareAmmo - ammoToUse
2486 UpdateAmmo(AmmoInClip)
2487 end
2488 Reloading = false
2489 end
2490end
2491
2492function OnFire()
2493 if IsShooting or stance == true then return end
2494 if MyHumanoid and MyHumanoid.Health > 0 then
2495 IsShooting = true
2496 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
2497 if Auto == false then
2498 LeftButtonDown = false
2499 end
2500 RecoilTrack:Play()
2501 if Spread and not DecreasedAimLastShot then
2502 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
2503 UpdateCrosshair(Spread)
2504 end
2505 DecreasedAimLastShot = not DecreasedAimLastShot
2506 if Handle:FindFirstChild('FireSound') then
2507 Handle.FireSound:Play()
2508 end
2509 CreateFlash()
2510 if MyMouse then
2511 local targetPoint = MyMouse.Hit.p
2512 local shootDirection = (targetPoint - Handle.Position).unit
2513 -- Adjust the shoot direction randomly off by a little bit to account for recoil
2514 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
2515 (0.5 - math.random()) * 2 * Spread,
2516 (0.5 - math.random()) * 2 * Spread) * shootDirection
2517 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
2518 local bullet
2519 -- Create a bullet here
2520 if hitObject then
2521 bullet = CreateBullet(bulletPos)
2522 end
2523 if hitObject and hitObject.Parent then
2524 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
2525 if hitHumanoid then
2526 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
2527 TagHumanoid(hitHumanoid, MyPlayer)
2528 if hitObject.Name == "Head" then
2529 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
2530 else
2531 hitHumanoid:TakeDamage(Damage)
2532 end
2533 if bullet then
2534 bullet:Destroy()
2535 bullet = nil
2536 --bullet.Transparency = 1
2537 end
2538 Spawn(UpdateTargetHit)
2539 end
2540 end
2541
2542 AmmoInClip = AmmoInClip - 1
2543 UpdateAmmo(AmmoInClip)
2544 end
2545 wait(FireRate)
2546 end
2547 IsShooting = false
2548 if AmmoInClip == 0 then
2549 Handle.Empty:Play()
2550 end
2551 if RecoilTrack then
2552 RecoilTrack:Stop()
2553 end
2554 end
2555end
2556
2557local TargetHits = 0
2558function UpdateTargetHit()
2559 TargetHits = TargetHits + 1
2560 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
2561 WeaponGui.Crosshair.TargetHitImage.Visible = true
2562 end
2563 wait(0.5)
2564 TargetHits = TargetHits - 1
2565 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
2566 WeaponGui.Crosshair.TargetHitImage.Visible = false
2567 end
2568end
2569
2570function UpdateCrosshair(value, mouse)
2571 if WeaponGui then
2572 local absoluteY = 650
2573 WeaponGui.Crosshair:TweenSize(
2574 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
2575 Enum.EasingDirection.Out,
2576 Enum.EasingStyle.Linear,
2577 0.33)
2578 end
2579end
2580
2581function UpdateAmmo(value)
2582 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
2583 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
2584 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
2585 WeaponGui.Crosshair.ReloadingLabel.Visible = false
2586 end
2587 end
2588 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
2589 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
2590 end
2591end
2592
2593
2594function OnMouseDown()
2595 LeftButtonDown = true
2596 OnFire()
2597end
2598
2599function OnMouseUp()
2600 LeftButtonDown = false
2601end
2602
2603function safety()
2604 if stance == false then
2605 stance = true
2606 Tool.Enabled = false
2607 passive:Play()
2608 else
2609 stance = false
2610 Tool.Enabled = true
2611 if passive then
2612 passive:Stop()
2613 end
2614 end
2615end
2616
2617function OnKeyDown(key)
2618 if string.lower(key) == 'r' then
2619 Reload()
2620 end
2621 if string.lower(key) == 'q' then
2622 safety()
2623 end
2624end
2625
2626
2627function OnEquipped(mouse)
2628 RecoilAnim = WaitForChild(Tool, 'FireAni')
2629 FireSound = WaitForChild(Handle, 'FireSound')
2630
2631 MyCharacter = Tool.Parent
2632 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
2633 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
2634 MyTorso = MyCharacter:FindFirstChild('Torso')
2635 MyMouse = mouse
2636 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
2637 if WeaponGui and MyPlayer then
2638 WeaponGui.Parent = MyPlayer.PlayerGui
2639 UpdateAmmo(AmmoInClip)
2640 end
2641 if RecoilAnim then
2642 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
2643 end
2644 idle = MyHumanoid:LoadAnimation(Tool.idle)
2645 idle:Play()
2646 gunidleanim = Instance.new("Animation")
2647 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
2648 passive = MyHumanoid:LoadAnimation(gunidleanim)
2649
2650 stance = false
2651 Tool.Enabled = true
2652
2653 if MyMouse then
2654 -- Disable mouse icon
2655 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
2656 MyMouse.Button1Down:connect(OnMouseDown)
2657 MyMouse.Button1Up:connect(OnMouseUp)
2658 MyMouse.KeyDown:connect(OnKeyDown)
2659 end
2660end
2661
2662
2663-- Unequip logic here
2664function OnUnequipped()
2665 if idle then
2666 idle:Stop()
2667 end
2668 if passive then
2669 passive:Stop()
2670 end
2671 LeftButtonDown = false
2672 Reloading = false
2673 MyCharacter = nil
2674 MyHumanoid = nil
2675 MyTorso = nil
2676 MyPlayer = nil
2677 MyMouse = nil
2678 if OnFireConnection then
2679 OnFireConnection:disconnect()
2680 end
2681 if OnReloadConnection then
2682 OnReloadConnection:disconnect()
2683 end
2684 if FlashHolder then
2685 FlashHolder = nil
2686 end
2687 if WeaponGui then
2688 WeaponGui.Parent = nil
2689 WeaponGui = nil
2690 end
2691 if RecoilTrack then
2692 RecoilTrack:Stop()
2693 end
2694end
2695
2696local function SetReticleColor(color)
2697 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
2698 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
2699 if line:IsA('Frame') then
2700 line.BorderColor3 = color
2701 end
2702 end
2703 end
2704end
2705
2706
2707Tool.Equipped:connect(OnEquipped)
2708Tool.Unequipped:connect(OnUnequipped)
2709
2710while true do
2711 wait(0.033)
2712 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
2713 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
2714 SetReticleColor(NeutralReticleColor)
2715
2716 local target = MyMouse.Target
2717 if target and target.Parent then
2718 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
2719 if player then
2720 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
2721 SetReticleColor(EnemyReticleColor)
2722 else
2723 SetReticleColor(FriendlyReticleColor)
2724 end
2725 end
2726 end
2727 end
2728 if Spread and not IsShooting then
2729 local currTime = time()
2730 if currTime - LastSpreadUpdate > FireRate * 2 then
2731 LastSpreadUpdate = currTime
2732 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
2733 UpdateCrosshair(Spread, MyMouse)
2734 end
2735 end
2736end
2737end))
2738Animation18.Name = "Reload"
2739Animation18.Parent = Tool4
2740Animation18.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
2741LocalScript19.Name = "CameraMoveDev"
2742LocalScript19.Parent = Tool4
2743table.insert(cors,sandbox(LocalScript19,function()
2744local RunService = game:GetService('RunService')
2745local player = game.Players.LocalPlayer
2746local mouse = player:GetMouse()
2747repeat wait() until player.Character
2748repeat wait() until player.Character:FindFirstChild("Humanoid")
2749repeat wait() until player.Character:FindFirstChild("Torso")
2750local character = player.Character
2751local humanoid = character:WaitForChild("Humanoid")
2752torso = character.Torso
2753keyhold = false
2754--player.CameraMinZoomDistance = 0.5
2755lighting = true
2756haslight = false
2757
2758mouse.TargetFilter = nil
2759
2760--humanoid.JumpPower = 0
2761
2762maxcount = 100
2763runcount = maxcount
2764
2765function populateparts(mdl)
2766 if mdl:IsA("BasePart") then
2767 table.insert(parts,mdl)
2768 end
2769 for i2,mdl2 in ipairs(mdl:GetChildren()) do
2770 populateparts(mdl2)
2771 end
2772end
2773
2774function weldBetween(a, b)
2775 --Make a new Weld and Parent it to a.
2776 weld = Instance.new("ManualWeld", a)
2777 --Get the CFrame of b relative to a.
2778 weld.C0 = a.CFrame:inverse() * b.CFrame
2779 --Set the Part0 and Part1 properties respectively
2780 weld.Part0 = a
2781 weld.Part1 = b
2782 --Return the reference to the weld so that you can change it later.
2783 return weld
2784end
2785
2786humanoid.Died:connect(function()
2787 if armgroup then
2788 armgroup:Destroy()
2789 if cl then
2790 cl:Destroy()
2791 end
2792 if cl2 then
2793 cl2:Destroy()
2794 end
2795 end
2796end)
2797
2798LocalObjects = {}
2799function SetLocalTransparency(Table)
2800 for i, v in pairs(LocalObjects) do
2801 if v.Object == Table.Object then
2802 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
2803 table.remove(LocalObjects, i)
2804 end
2805 end
2806 if not Table.Transparency then
2807 return
2808 end
2809 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
2810 table.insert(LocalObjects, Table)
2811 if ModifyTransparency then
2812 ModifyTransparency:disconnect()
2813 end
2814 ModifyTransparency = RunService.RenderStepped:connect(function()
2815 for i, v in pairs(LocalObjects) do
2816 if v.Object and v.Object.Parent then
2817 local CurrentTransparency = v.Object.LocalTransparencyModifier
2818 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
2819 v.Object.LocalTransparencyModifier = v.Transparency
2820 end
2821 else
2822 table.remove(LocalObjects, i)
2823 end
2824 end
2825 end)
2826end
2827
2828local function SetupJoints()
2829 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
2830 return -- TODO: Make tracking compatible with R15
2831 end
2832 torso = character:FindFirstChild("Torso")
2833
2834 Neck = torso.Neck
2835 OldNeckC0 = Neck.C0
2836 OldNeckC1 = Neck.C1
2837 Shoulder = torso['Right Shoulder']
2838 Shoulder2 = torso['Left Shoulder']
2839 OldShoulderC0 = Shoulder.C0
2840 OldShoulderC1 = Shoulder.C1
2841 OldShoulder2C0 = Shoulder2.C0
2842 OldShoulder2C1 = Shoulder2.C1
2843end
2844
2845local function visual()
2846 if Tool then
2847 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
2848 Color = Instance.new("ColorCorrectionEffect")
2849 Color.Name = "KillColor"
2850 Color.Saturation = -0.5
2851 Color.Parent = game.Workspace.CurrentCamera
2852 game.Debris:AddItem(Color, 0.22)
2853 Blur = Instance.new("BlurEffect")
2854 Blur.Name = "KillBlur"
2855 Blur.Size = 8
2856 Blur.Parent = game.Workspace.CurrentCamera
2857 game.Debris:AddItem(Blur, 0.22)
2858 Tool.GetKill:Destroy()
2859 end
2860
2861 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
2862 Color = Instance.new("ColorCorrectionEffect")
2863 Color.Name = "KillColor"
2864 Color.Saturation = -0.75
2865 Color.TintColor = Color3.new(1, 0.9, 0.9)
2866 Color.Parent = game.Workspace.CurrentCamera
2867 game.Debris:AddItem(Color, 0.22)
2868 Blur = Instance.new("BlurEffect")
2869 Blur.Name = "KillBlur"
2870 Blur.Size = 8
2871 Blur.Parent = game.Workspace.CurrentCamera
2872 game.Debris:AddItem(Blur, 0.22)
2873 Tool.GetHeadKill:Destroy()
2874 end
2875 end
2876
2877 --player.CameraMode = Enum.CameraMode.LockFirstPerson
2878
2879end
2880
2881SetupJoints()
2882
2883game:GetService("RunService").RenderStepped:connect(function()
2884 if character and humanoid.Health > 0 and script.Parent.Parent == character then
2885 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
2886 Tool = character:FindFirstChildOfClass("Tool")
2887 visual()
2888 else
2889 Tool = nil
2890 end
2891 if Tool and Tool.Enabled == true then
2892 character.Humanoid.AutoRotate = false
2893
2894 mouse.TargetFilter = game.Workspace
2895 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
2896 --game.Workspace.CurrentCamera.CameraSubject = character.Head
2897 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
2898 --end
2899
2900 character['Torso'].Neck.C0 = OldNeckC0
2901 character['Torso'].Neck.C1 = OldNeckC1
2902 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
2903 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
2904 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
2905 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
2906
2907 local toMouse = (mouse.Hit.p - character.Head.Position).unit
2908 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
2909 local neckAngle = angle
2910 if math.deg(neckAngle) > 110 then
2911 neckAngle = math.rad(110)
2912 end
2913
2914 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
2915
2916 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
2917 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
2918
2919 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
2920 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
2921 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
2922 end
2923 else
2924 if armgroup then
2925 armgroup:Destroy()
2926 armgroup = nil
2927 end
2928 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
2929 character['Torso'].Neck.C0 = OldNeckC0
2930 character['Torso'].Neck.C1 = OldNeckC1
2931 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
2932 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
2933 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
2934 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
2935
2936 character.Humanoid.AutoRotate = true
2937 mouse.TargetFilter = nil
2938
2939 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
2940 for i, v in pairs(character:GetChildren()) do
2941 if v:IsA("BasePart") then
2942 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
2943 end
2944 if v:IsA("Accessory") then
2945 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
2946 end
2947 end
2948 end
2949 end
2950 end
2951end)
2952
2953script.Parent.Unequipped:connect(function()
2954 if armgroup then
2955 armgroup:Destroy()
2956 armgroup = nil
2957 end
2958 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
2959 character['Torso'].Neck.C0 = OldNeckC0
2960 character['Torso'].Neck.C1 = OldNeckC1
2961 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
2962 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
2963 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
2964 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
2965
2966 character.Humanoid.AutoRotate = true
2967 mouse.TargetFilter = nil
2968
2969 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
2970 for i, v in pairs(character:GetChildren()) do
2971 if v:IsA("BasePart") then
2972 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
2973 end
2974 if v:IsA("Accessory") then
2975 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
2976 end
2977 end
2978 end
2979end)
2980end))
2981Part20.Name = "Handle"
2982Part20.Parent = Tool4
2983Part20.BrickColor = BrickColor.new("Pastel yellow")
2984Part20.Rotation = Vector3.new(0, -89.9399948, 0)
2985Part20.CanCollide = false
2986Part20.FormFactor = Enum.FormFactor.Custom
2987Part20.Size = Vector3.new(0.200000003, 1.20000005, 0.699999988)
2988Part20.CFrame = CFrame.new(70.1900024, 2.50001621, 26.3299923, 0, 0, -0.999999523, -0.999999523, 0, 0, 0, 1, 0)
2989Part20.BottomSurface = Enum.SurfaceType.Smooth
2990Part20.TopSurface = Enum.SurfaceType.Smooth
2991Part20.Color = Color3.new(1, 1, 0.8)
2992Part20.Position = Vector3.new(70.1900024, 2.50001621, 26.3299923)
2993Part20.Orientation = Vector3.new(0, -90, -90)
2994Part20.Color = Color3.new(1, 1, 0.8)
2995SpecialMesh21.Parent = Part20
2996SpecialMesh21.MeshId = "http://www.roblox.com/asset/?id=72012879"
2997SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
2998SpecialMesh21.TextureId = "http://www.roblox.com/asset/?id=72012859"
2999SpecialMesh21.VertexColor = Vector3.new(2, 2, 2)
3000SpecialMesh21.MeshType = Enum.MeshType.FileMesh
3001SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
3002Sound22.Name = "Empty"
3003Sound22.Parent = Part20
3004Sound22.SoundId = "rbxassetid://240785604"
3005Sound22.Volume = 1
3006Sound23.Name = "FireSound"
3007Sound23.Parent = Part20
3008Sound23.SoundId = "rbxassetid://330704232"
3009Sound23.Volume = 1
3010Sound24.Name = "Reload"
3011Sound24.Parent = Part20
3012Sound24.SoundId = "rbxassetid://198915489"
3013Sound24.Volume = 1
3014Fire25.Parent = Part20
3015Fire25.Size = 2
3016Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
3017Fire25.Enabled = false
3018Fire25.Heat = 0
3019Fire25.SecondaryColor = Color3.new(0, 0, 0)
3020Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
3021SpotLight26.Name = "Light"
3022SpotLight26.Parent = Part20
3023SpotLight26.Color = Color3.new(1, 1, 0.498039)
3024SpotLight26.Enabled = false
3025SpotLight26.Brightness = 50
3026SpotLight26.Range = 18
3027SpotLight26.Angle = 120
3028SpotLight26.Face = Enum.NormalId.Top
3029SpotLight26.Color = Color3.new(1, 1, 0.498039)
3030Animation27.Name = "FireAni"
3031Animation27.Parent = Tool4
3032Animation27.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
3033Animation28.Name = "idle"
3034Animation28.Parent = Tool4
3035Animation28.AnimationId = "http://www.roblox.com/Asset?ID=95383474"
3036Tool29.Name = "Baton"
3037Tool29.Parent = mas
3038LocalScript30.Name = "Local Gui"
3039LocalScript30.Parent = Tool29
3040table.insert(cors,sandbox(LocalScript30,function()
3041local Tool = script.Parent;
3042
3043enabled = true
3044function onButton1Down(mouse)
3045 if not enabled then
3046 return
3047 end
3048
3049 enabled = true
3050
3051end
3052
3053function onEquippedLocal(mouse)
3054
3055 if mouse == nil then
3056 print("Mouse not found")
3057 return
3058 end
3059
3060 mouse.Icon = "http://www.roblox.com/asset/?id=2966012"
3061 mouse.Button1Down:connect(function() onButton1Down(mouse) end)
3062end
3063
3064
3065Tool.Equipped:connect(onEquippedLocal)
3066
3067end))
3068Script31.Name = "Weld"
3069Script31.Parent = Tool29
3070table.insert(cors,sandbox(Script31,function()
3071local prev
3072local parts = script.Parent:GetChildren()
3073for i = 1,#parts do
3074--remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld
3075 if ((parts[i].className == "Part") or (parts[i].className == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) then
3076 if (prev ~= nil) then
3077 local weld = Instance.new("Weld")
3078 weld.Part0 = prev
3079 weld.Part1 = parts[i]
3080 weld.C0 = prev.CFrame:inverse()
3081 weld.C1 = parts[i].CFrame:inverse()
3082 weld.Parent = prev
3083 parts[i].Anchored = false
3084 end
3085 prev = parts[i]
3086 end
3087end
3088wait(3)
3089
3090end))
3091Part32.Name = "Handle"
3092Part32.Parent = Tool29
3093Part32.Material = Enum.Material.Fabric
3094Part32.BrickColor = BrickColor.new("Black")
3095Part32.Rotation = Vector3.new(180, 0, -165)
3096Part32.FormFactor = Enum.FormFactor.Custom
3097Part32.Size = Vector3.new(0.300000012, 1, 0.300000012)
3098Part32.CFrame = CFrame.new(13.0473738, 2.52178431, 3.16040182, -0.965922058, 0.258817792, -3.82533472e-09, 0.258817792, 0.965922058, -2.83325789e-08, -3.77935461e-09, -2.80197128e-08, -1)
3099Part32.BottomSurface = Enum.SurfaceType.Weld
3100Part32.TopSurface = Enum.SurfaceType.Smooth
3101Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
3102Part32.Position = Vector3.new(13.0473738, 2.52178431, 3.16040182)
3103Part32.Orientation = Vector3.new(0, -180, 15)
3104Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
3105CylinderMesh33.Parent = Part32
3106CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
3107CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
3108Weld34.Parent = Part32
3109Weld34.C0 = CFrame.new(-457.99826, -25.7006931, 446.902222, -1, 3.05171125e-05, 3.05180438e-05, 3.05180438e-05, 1, 3.05171125e-05, -3.05171125e-05, 3.05180438e-05, -1)
3110Weld34.C1 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3111Weld34.Part0 = Part32
3112Weld34.Part1 = Part40
3113Sound35.Name = "HitSound"
3114Sound35.Parent = Part32
3115Sound35.SoundId = "rbxassetid://169259022"
3116Sound35.Volume = 1
3117Sound36.Name = "LungeSound"
3118Sound36.Parent = Part32
3119Sound36.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3120Sound36.Volume = 1
3121Sound37.Name = "OverheadSound"
3122Sound37.Parent = Part32
3123Sound37.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3124Sound37.Volume = 1
3125Sound38.Name = "UnsheathSound"
3126Sound38.Parent = Part32
3127Sound38.SoundId = "rbxassetid://240784215"
3128Sound38.Volume = 1
3129Sound39.Name = "SlashSound"
3130Sound39.Parent = Part32
3131Sound39.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3132Sound39.Volume = 1
3133Part40.Parent = Tool29
3134Part40.BrickColor = BrickColor.new("Really black")
3135Part40.Reflectance = 0.20000000298023
3136Part40.Rotation = Vector3.new(0, 0, 165)
3137Part40.FormFactor = Enum.FormFactor.Custom
3138Part40.Size = Vector3.new(0.300000012, 1, 0.300000012)
3139Part40.CFrame = CFrame.new(13.5757141, 4.45773554, 3.16909885, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
3140Part40.BottomSurface = Enum.SurfaceType.Weld
3141Part40.TopSurface = Enum.SurfaceType.Weld
3142Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3143Part40.Position = Vector3.new(13.5757141, 4.45773554, 3.16909885)
3144Part40.Orientation = Vector3.new(0, 0, 165)
3145Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3146CylinderMesh41.Parent = Part40
3147CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
3148CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
3149Weld42.Parent = Part40
3150Weld42.C0 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3151Weld42.C1 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3152Weld42.Part0 = Part40
3153Weld42.Part1 = Part44
3154Script43.Parent = Part40
3155table.insert(cors,sandbox(Script43,function()
3156function onTouched(hit)
3157h = hit.Parent:findFirstChild("Humanoid")
3158if h ~= nil then
3159h.Sit = true
3160h.Health = h.Health - 0
3161end
3162end
3163script.Parent.Touched:connect(onTouched)
3164
3165end))
3166Part44.Parent = Tool29
3167Part44.BrickColor = BrickColor.new("Really black")
3168Part44.Reflectance = 0.20000000298023
3169Part44.Rotation = Vector3.new(0, 0, 165)
3170Part44.FormFactor = Enum.FormFactor.Custom
3171Part44.Size = Vector3.new(0.300000012, 1, 0.300000012)
3172Part44.CFrame = CFrame.new(13.3080959, 3.48419905, 3.16299605, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
3173Part44.BottomSurface = Enum.SurfaceType.Weld
3174Part44.TopSurface = Enum.SurfaceType.Weld
3175Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3176Part44.Position = Vector3.new(13.3080959, 3.48419905, 3.16299605)
3177Part44.Orientation = Vector3.new(0, 0, 165)
3178Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3179CylinderMesh45.Parent = Part44
3180CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
3181CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
3182Weld46.Parent = Part44
3183Weld46.C0 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3184Weld46.C1 = CFrame.new(-457.993408, 28.2644634, -446.909058, -1, -3.05161811e-05, 3.05189751e-05, 3.05189751e-05, -1, 9.15522687e-05, 3.05161811e-05, 9.15532e-05, 1)
3185Weld46.Part0 = Part44
3186Weld46.Part1 = Part48
3187Script47.Parent = Part44
3188table.insert(cors,sandbox(Script47,function()
3189function onTouched(hit)
3190h = hit.Parent:findFirstChild("Humanoid")
3191if h ~= nil then
3192h.Sit = true
3193h.Health = h.Health - 0
3194end
3195end
3196script.Parent.Touched:connect(onTouched)
3197
3198end))
3199Part48.Parent = Tool29
3200Part48.BrickColor = BrickColor.new("Really black")
3201Part48.Reflectance = 0.20000000298023
3202Part48.Rotation = Vector3.new(-0.00999999978, 0, 165)
3203Part48.FormFactor = Enum.FormFactor.Custom
3204Part48.Size = Vector3.new(0.300000012, 0.200000003, 0.300000012)
3205Part48.CFrame = CFrame.new(13.7208099, 5.02307796, 3.16375327, -0.965937853, -0.258758843, 3.15935395e-05, 0.258758843, -0.965937853, 0.000117940843, -9.83733317e-10, 0.000122099271, 1)
3206Part48.BottomSurface = Enum.SurfaceType.Smooth
3207Part48.TopSurface = Enum.SurfaceType.Weld
3208Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3209Part48.Position = Vector3.new(13.7208099, 5.02307796, 3.16375327)
3210Part48.Orientation = Vector3.new(-0.00999999978, 0, 165)
3211Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3212CylinderMesh49.Parent = Part48
3213CylinderMesh49.Offset = Vector3.new(0, 0.150000006, 0)
3214CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
3215CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
3216Script50.Parent = Part48
3217table.insert(cors,sandbox(Script50,function()
3218function onTouched(hit)
3219h = hit.Parent:findFirstChild("Humanoid")
3220if h ~= nil then
3221h.Sit = true
3222h.Health = h.Health - 0
3223end
3224end
3225script.Parent.Touched:connect(onTouched)
3226
3227end))
3228BoolValue51.Name = "PlayOverhead"
3229BoolValue51.Parent = Tool29
3230BoolValue52.Name = "PlaySlash"
3231BoolValue52.Parent = Tool29
3232BoolValue53.Name = "PlayThrust"
3233BoolValue53.Parent = Tool29
3234Script54.Name = "SwordScript"
3235Script54.Parent = Tool29
3236table.insert(cors,sandbox(Script54,function()
3237r = game:service("RunService")
3238
3239local damage = 0
3240
3241sword = script.Parent.Handle
3242Tool = script.Parent
3243
3244local damages,values,sounds = {15,17,20},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
3245local enabledToDamage = true
3246
3247function blow(hit)
3248 if enabledToDamage == false then return end
3249 enabledToDamage = false
3250 if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
3251 local humanoid = hit.Parent:findFirstChild("Humanoid")
3252 local vCharacter = Tool.Parent
3253 local vPlayer = game.Players:playerFromCharacter(vCharacter)
3254 local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
3255 if humanoid~=nil and humanoid ~= hum and hum ~= nil then
3256 -- final check, make sure sword is in-hand
3257 local right_arm = vCharacter:FindFirstChild("Right Arm")
3258 if (right_arm ~= nil) then
3259 local joint = right_arm:FindFirstChild("RightGrip")
3260 if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
3261 tagHumanoid(humanoid, vPlayer)
3262 humanoid:TakeDamage(damage)
3263 delay(1, function()
3264 untagHumanoid(humanoid)
3265 end)
3266 else
3267 enabledToDamage = true
3268 end
3269 else
3270 enabledToDamage = true
3271 end
3272 else
3273 enabledToDamage = true
3274 end
3275end
3276
3277
3278function tagHumanoid(humanoid, player)
3279 local creator_tag = Instance.new("ObjectValue")
3280 creator_tag.Value = player
3281 creator_tag.Name = "creator"
3282 creator_tag.Parent = humanoid
3283end
3284
3285function untagHumanoid(humanoid)
3286 if humanoid ~= nil then
3287 local tag = humanoid:findFirstChild("creator")
3288 if tag ~= nil then
3289 tag.Parent = nil
3290 end
3291 end
3292end
3293
3294
3295function attack()
3296 damage = slash_damage
3297 script.Parent.Handle.SlashSound:Play()
3298 script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
3299end
3300
3301function lunge()
3302 damage = lunge_damage
3303 script.Parent.Handle.LungeSound:Play()
3304 script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
3305 force = Instance.new("BodyVelocity")
3306 force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
3307 force.Parent = Tool.Parent.Torso
3308 wait(.5)
3309 force.Parent = nil
3310 wait(.5)
3311 damage = slash_damage
3312end
3313
3314
3315Tool.Enabled = true
3316local last_attack = 0
3317local status = 0
3318
3319function onActivated()
3320 if not Tool.Enabled then
3321 return
3322 end
3323 Tool.Enabled = false
3324 local character = Tool.Parent;
3325 local humanoid = character.Humanoid
3326 if humanoid == nil then
3327 print("Humanoid not found")
3328 return
3329 end
3330 t = r.Stepped:wait()
3331 --if (t - last_attack < 1.5) then
3332 if status == 3 then
3333 status = 0
3334 damage = 0
3335 else
3336 status = status + 1
3337 values[status].Value = not values[status].Value
3338 damage = damages[status]
3339 sounds[status]:Play()
3340 enabledToDamage = true
3341 wait(0.5)
3342 enabledToDamage = false
3343 end
3344 --else
3345 --status = 0
3346 --damage = 0
3347 --end
3348 last_attack = t
3349 Tool.Enabled = true
3350end
3351
3352function onEquipped()
3353 wait(1/3)
3354 Tool.Handle.UnsheathSound:Play()
3355end
3356
3357Tool.Equipped:connect(onEquipped)
3358script.Parent.Activated:connect(onActivated)
3359connection = sword.Touched:connect(blow)
3360end))
3361LocalScript55.Name = "AnimationScript"
3362LocalScript55.Parent = Tool29
3363table.insert(cors,sandbox(LocalScript55,function()
3364-- Waits for the child of the specified parent
3365local function WaitForChild(parent, childName)
3366 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3367 return parent[childName]
3368end
3369
3370local Tool = script.Parent
3371
3372local Animations = {}
3373local MyHumanoid
3374local MyCharacter
3375
3376
3377local function PlayAnimation(animationName)
3378 if Animations[animationName] then
3379 Animations[animationName]:Play()
3380 end
3381end
3382
3383local function StopAnimation(animationName)
3384 if Animations[animationName] then
3385 Animations[animationName]:Stop()
3386 end
3387end
3388
3389
3390function OnEquipped(mouse)
3391 MyCharacter = Tool.Parent
3392 MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
3393 if MyHumanoid then
3394 Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
3395 Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
3396 Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
3397 Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
3398 Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
3399 Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
3400 end
3401 PlayAnimation('EquipAnim')
3402 PlayAnimation('IdleAnim')
3403end
3404
3405function OnUnequipped()
3406 for animName, _ in pairs(Animations) do
3407 StopAnimation(animName)
3408 end
3409end
3410
3411Tool.Equipped:connect(OnEquipped)
3412Tool.Unequipped:connect(OnUnequipped)
3413
3414WaitForChild(Tool, 'PlaySlash').Changed:connect(
3415 function (value)
3416 --if value then
3417 PlayAnimation('SlashAnim')
3418 --else
3419 -- StopAnimation('SlashAnim')
3420 --end
3421 end)
3422
3423WaitForChild(Tool, 'PlayThrust').Changed:connect(
3424 function (value)
3425 --if value then
3426 PlayAnimation('ThrustAnim')
3427 --else
3428 -- StopAnimation('ThrustAnim')
3429 --end
3430 end)
3431
3432WaitForChild(Tool, 'PlayOverhead').Changed:connect(
3433 function (value)
3434 --if value then
3435 PlayAnimation('OverheadAnim')
3436 --else
3437 -- StopAnimation('OverheadAnim')
3438 --end
3439 end)
3440
3441end))
3442Animation56.Name = "IdleAnim3"
3443Animation56.Parent = Tool29
3444Animation56.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
3445Animation57.Name = "OverheadAnim2"
3446Animation57.Parent = Tool29
3447Animation57.AnimationId = "rbxassetid://186934753"
3448Animation58.Name = "UnequipAnim2"
3449Animation58.Parent = Tool29
3450Animation58.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
3451Animation59.Name = "EquipAnim5"
3452Animation59.Parent = Tool29
3453Animation59.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
3454Animation60.Name = "ThrustAnim2"
3455Animation60.Parent = Tool29
3456Animation60.AnimationId = "rbxassetid://186934753"
3457Animation61.Name = "SlashAnim2"
3458Animation61.Parent = Tool29
3459Animation61.AnimationId = "rbxassetid://186934753"
3460Tool62.Name = "RPG-7"
3461Tool62.Parent = mas
3462Tool62.GripPos = Vector3.new(0.0500000007, -0.600000024, -1)
3463Tool62.ToolTip = "RPG-7"
3464Tool62.CanBeDropped = false
3465Part63.Name = "Handle"
3466Part63.Parent = Tool62
3467Part63.Transparency = 1
3468Part63.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
3469Part63.FormFactor = Enum.FormFactor.Custom
3470Part63.Size = Vector3.new(0.839999974, 1.14999998, 3.55000019)
3471Part63.CFrame = CFrame.new(-70.7470474, 13.1006594, 24.1488132, -0.0153169353, 0.469224393, 0.882945836, 0.00813866127, 0.883078873, -0.469153851, -0.999849558, 0, -0.0173449218)
3472Part63.BottomSurface = Enum.SurfaceType.Smooth
3473Part63.TopSurface = Enum.SurfaceType.Smooth
3474Part63.Position = Vector3.new(-70.7470474, 13.1006594, 24.1488132)
3475Part63.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
3476SpecialMesh64.Parent = Part63
3477SpecialMesh64.MeshId = "http://www.roblox.com/asset/?id=94690054"
3478SpecialMesh64.TextureId = "http://www.roblox.com/asset/?id=94689966"
3479SpecialMesh64.MeshType = Enum.MeshType.FileMesh
3480Sound65.Name = "ReloadSound"
3481Sound65.Parent = Part63
3482Sound65.Pitch = 1.1000000238419
3483Sound65.SoundId = "http://www.roblox.com/Asset?ID=132456167"
3484Sound65.Volume = 1
3485Sound66.Name = "FireSound"
3486Sound66.Parent = Part63
3487Sound66.SoundId = "http://www.roblox.com/Asset?ID=132456187"
3488Sound66.Volume = 1
3489LocalScript67.Name = "MouseIcon"
3490LocalScript67.Parent = Tool62
3491table.insert(cors,sandbox(LocalScript67,function()
3492local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
3493local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
3494
3495local Tool = script.Parent
3496
3497local Mouse = nil
3498
3499local function UpdateIcon()
3500 Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
3501end
3502
3503local function OnEquipped(mouse)
3504 Mouse = mouse
3505 UpdateIcon()
3506end
3507
3508local function OnChanged(property)
3509 if property == 'Enabled' then
3510 UpdateIcon()
3511 end
3512end
3513
3514Tool.Equipped:connect(OnEquipped)
3515Tool.Changed:connect(OnChanged)
3516
3517end))
3518Script68.Name = "Launcher"
3519Script68.Parent = Tool62
3520table.insert(cors,sandbox(Script68,function()
3521-----------------
3522--| Constants |--
3523-----------------
3524
3525local COOLDOWN = 4 -- Seconds until tool can be used again
3526
3527-- RocketPropulsion Fields
3528local TARGET_RADIUS = 5
3529local MAX_SPEED = 95
3530local MAX_TORQUE = Vector3.new(4e6, 4e6, 0)
3531local MAX_THRUST = 50000
3532local THRUST_P = 500
3533local THRUST_D = 50000
3534
3535local TARGET_OVERSHOOT_DISTANCE = 10000000
3536
3537local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081'
3538local ROCKET_MESH_SCALE = Vector3.new(2.5, 2.5, 2)
3539local ROCKET_PART_SIZE = Vector3.new(1, 1, 4)
3540
3541--------------------
3542--| WaitForChild |--
3543--------------------
3544
3545-- Waits for parent.child to exist, then returns it
3546local function WaitForChild(parent, childName)
3547 assert(parent, "ERROR: WaitForChild: parent is nil")
3548 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3549 return parent[childName]
3550end
3551
3552-----------------
3553--| Variables |--
3554-----------------
3555
3556local DebrisService = Game:GetService('Debris')
3557local PlayersService = Game:GetService('Players')
3558
3559local Tool = script.Parent
3560local ToolHandle = Tool.Handle
3561
3562local RocketScript = WaitForChild(script, 'Rocket')
3563
3564local SwooshSound = WaitForChild(script, 'Swoosh')
3565local BoomSound = WaitForChild(script, 'Boom')
3566local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
3567local FireSound = WaitForChild(ToolHandle, 'FireSound')
3568
3569local MyModel = nil
3570local MyPlayer = nil
3571
3572local BaseRocket = nil
3573local RocketClone = nil
3574
3575-----------------
3576--| Functions |--
3577-----------------
3578
3579local function MakeBaseRocket()
3580 -- Set up the rocket part
3581 local rocket = Instance.new('Part')
3582 rocket.Name = 'Rocket'
3583 rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
3584 rocket.Size = ROCKET_PART_SIZE
3585 rocket.CanCollide = false
3586 rocket.BottomSurface = Enum.SurfaceType.Smooth
3587 rocket.TopSurface = Enum.SurfaceType.Smooth
3588
3589 -- Add the mesh
3590 local mesh = Instance.new('SpecialMesh', rocket)
3591 mesh.MeshId = ROCKET_MESH_ID
3592 mesh.Scale = ROCKET_MESH_SCALE
3593 mesh.TextureId = ToolHandle.Mesh.TextureId
3594
3595 -- Add fire
3596 local fire = Instance.new('Fire', rocket)
3597 fire.Heat = 3
3598 fire.Size = 2
3599
3600 -- Add the propulsion
3601 local rocketPropulsion = Instance.new('RocketPropulsion', rocket)
3602 rocketPropulsion.CartoonFactor = 1
3603 rocketPropulsion.TargetRadius = TARGET_RADIUS
3604 rocketPropulsion.MaxSpeed = MAX_SPEED
3605 rocketPropulsion.MaxTorque = MAX_TORQUE
3606 rocketPropulsion.MaxThrust = MAX_THRUST
3607 rocketPropulsion.ThrustP = THRUST_P
3608 rocketPropulsion.ThrustD = THRUST_D
3609
3610 -- Clone the sounds
3611 local swooshSoundClone = SwooshSound:Clone()
3612 swooshSoundClone.Parent = rocket
3613 local boomSoundClone = BoomSound:Clone()
3614 boomSoundClone.Parent = rocket
3615
3616 -- Attach creator tags
3617 local creatorTag = Instance.new('ObjectValue', rocket)
3618 creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
3619 creatorTag.Value = MyPlayer
3620 local iconTag = Instance.new('StringValue', creatorTag)
3621 iconTag.Name = 'icon'
3622 iconTag.Value = Tool.TextureId
3623
3624 -- Finally, clone the rocket script and enable it
3625 local rocketScriptClone = RocketScript:Clone()
3626 rocketScriptClone.Parent = rocket
3627 rocketScriptClone.Disabled = false
3628
3629 return rocket
3630end
3631
3632local function OnEquipped()
3633 MyModel = Tool.Parent
3634 MyPlayer = PlayersService:GetPlayerFromCharacter(MyModel)
3635 BaseRocket = MakeBaseRocket()
3636 RocketClone = BaseRocket:Clone()
3637end
3638
3639local function OnActivated(byFireButton)
3640 if Tool.Enabled and MyModel and MyModel:FindFirstChild('Humanoid') and MyModel.Humanoid.Health > 0 then
3641 Tool.Enabled = false
3642
3643 -- Get the target position
3644 local targetPosition = MyModel.Humanoid.TargetPoint
3645 if byFireButton then -- Using Fire Button, shoot forwards
3646 targetPosition = MyModel.Humanoid.Torso.CFrame.lookVector * 1000
3647 end
3648
3649 -- Position the rocket clone
3650 local spawnPosition = ToolHandle.Position + (ToolHandle.CFrame.lookVector * (ToolHandle.Size.z / 2))
3651 RocketClone.CFrame = CFrame.new(spawnPosition, targetPosition) --NOTE: This must be done before assigning Parent
3652 DebrisService:AddItem(RocketClone, 30)
3653 RocketClone.Parent = Workspace
3654
3655 -- Assign target and launch!
3656 FireSound:Play()
3657 local rocketPropulsion = RocketClone:FindFirstChild('RocketPropulsion')
3658 if rocketPropulsion then
3659 local direction = (targetPosition - RocketClone.Position).unit
3660 rocketPropulsion.TargetOffset = RocketClone.Position + (direction * TARGET_OVERSHOOT_DISTANCE)
3661 rocketPropulsion:Fire()
3662 end
3663
3664 RocketClone.Touched:connect(function(hit)
3665 --print("oof")
3666
3667 -----------------
3668--| Constants |--
3669-----------------
3670
3671local BLAST_RADIUS = 6
3672local BLAST_PRESSURE = 750000
3673
3674-- Rocket will fly through things named these
3675local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
3676
3677--------------------
3678--| WaitForChild |--
3679--------------------
3680
3681-- Waits for parent.child to exist, then returns it
3682local function WaitForChild(parent, childName)
3683 assert(parent, "ERROR: WaitForChild: parent is nil")
3684 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3685 return parent[childName]
3686end
3687
3688-----------------
3689--| Variables |--
3690-----------------
3691
3692local DebrisService = Game:GetService('Debris')
3693
3694local Rocket = RocketClone
3695local CreatorTag = WaitForChild(Rocket, 'creator')
3696
3697local Connection = nil
3698
3699-----------------
3700--| Functions |--
3701-----------------
3702
3703-- Returns the ancestor that contains a Humanoid, if it exists
3704local function FindCharacterAncestor(subject)
3705 if subject and subject ~= Workspace then
3706 local humanoid = subject:FindFirstChild('Humanoid')
3707 if humanoid then
3708 return subject, humanoid
3709 else
3710 return FindCharacterAncestor(subject.Parent)
3711 end
3712 end
3713 return nil
3714end
3715
3716local function OnExplosionHit(hitPart)
3717 if hitPart then
3718 local _, humanoid = FindCharacterAncestor(hitPart.Parent)
3719 if humanoid then
3720 humanoid.Parent:BreakJoints()
3721 local hitBindable = humanoid:FindFirstChild('Hit')
3722 if hitBindable then
3723 hitBindable:Invoke(0, CreatorTag)
3724 else
3725 print("Could not find BindableFunction 'Hit'")
3726 end
3727 end
3728 end
3729end
3730
3731local function OnTouched(otherPart)
3732 if Rocket and otherPart and not Rocket:FindFirstChild("IsDone") then
3733 -- Fly through anything in the ignore list
3734 if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
3735 return
3736 end
3737
3738 -- Fly through the creator
3739 local myPlayer = CreatorTag.Value
3740 if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
3741 return
3742 end
3743
3744 -- Create the explosion
3745 local explosion = Instance.new('Explosion')
3746 explosion.BlastPressure = BLAST_PRESSURE
3747 explosion.BlastRadius = BLAST_RADIUS
3748 explosion.Position = Rocket.Position
3749 explosion.Hit:connect(OnExplosionHit)
3750 explosion.Parent = Workspace
3751
3752 tag = Instance.new("BoolValue", Rocket)
3753 tag.Name = "IsDone"
3754
3755 -- Start playing the boom sound
3756 local boomSound = Rocket:FindFirstChild('Boom')
3757 if boomSound then
3758 boomSound:Play()
3759 end
3760
3761 -- NOTE:
3762 -- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
3763 -- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
3764
3765 -- Stop playing the swoosh sound
3766 local swooshSound = Rocket:FindFirstChild('Swoosh')
3767 if swooshSound then
3768 swooshSound:Stop()
3769 end
3770
3771 -- Put out the fire
3772 local fire = Rocket:FindFirstChild('Fire')
3773 if fire then
3774 fire:Destroy()
3775 end
3776
3777 Rocket.Transparency = 1
3778 Rocket.CanCollide = false
3779 Rocket.Anchored = true
3780 DebrisService:AddItem(Rocket, 3)
3781
3782 -- Destroy the connection so this method won't be called again
3783 Connection:disconnect()
3784 end
3785end
3786
3787--------------------
3788--| Script Logic |--
3789--------------------
3790
3791-- Arm the rocket and save the touch connection so we can disconnect it later
3792Connection = Rocket.Touched:connect(OnTouched)
3793
3794 end)
3795
3796 wait(0) --TODO: Remove when sounds realize they can be played as soon as they enter the Workspace
3797
3798 -- Swoosh!
3799 local swooshSound = RocketClone:FindFirstChild('Swoosh')
3800 if swooshSound then
3801 swooshSound:Play()
3802 end
3803
3804 -- Prepare the next rocket to be fired
3805 RocketClone = BaseRocket:Clone()
3806
3807 ReloadSound:Play()
3808
3809 wait(COOLDOWN)
3810
3811 -- Stop the reloading sound if it hasn't already finished
3812 ReloadSound:Stop()
3813
3814 Tool.Enabled = true
3815 end
3816end
3817
3818local function OnUnequipped()
3819 ReloadSound:Stop() --TODO: This does not work online
3820end
3821
3822-- Also activate when the Fire Button is down
3823local function OnChildAdded(child)
3824 if child.Name == 'FireButtonDown' then
3825 child.Changed:connect(function(newValue)
3826 if newValue == true then
3827 OnActivated(true)
3828 end
3829 end)
3830 end
3831end
3832
3833--------------------
3834--| Script Logic |--
3835--------------------
3836
3837Tool.Equipped:connect(OnEquipped)
3838Tool.Activated:connect(OnActivated)
3839Tool.Unequipped:connect(OnUnequipped)
3840Tool.ChildAdded:connect(OnChildAdded) --NOTE: Added for Fire Button
3841
3842end))
3843Sound69.Name = "Boom"
3844Sound69.Parent = Script68
3845Sound69.SoundId = "http://www.roblox.com/Asset?ID=133680244"
3846Sound69.Volume = 1
3847Sound70.Name = "Swoosh"
3848Sound70.Parent = Script68
3849Sound70.Pitch = 1.2999999523163
3850Sound70.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
3851Sound70.Volume = 0.69999998807907
3852Sound70.Looped = true
3853Script71.Name = "Rocket"
3854Script71.Parent = Script68
3855Script71.Disabled = true
3856table.insert(cors,sandbox(Script71,function()
3857-----------------
3858--| Constants |--
3859-----------------
3860
3861local BLAST_RADIUS = 6
3862local BLAST_PRESSURE = 750000
3863
3864-- Rocket will fly through things named these
3865local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
3866
3867--------------------
3868--| WaitForChild |--
3869--------------------
3870
3871-- Waits for parent.child to exist, then returns it
3872local function WaitForChild(parent, childName)
3873 assert(parent, "ERROR: WaitForChild: parent is nil")
3874 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3875 return parent[childName]
3876end
3877
3878-----------------
3879--| Variables |--
3880-----------------
3881
3882local DebrisService = Game:GetService('Debris')
3883
3884local Rocket = script.Parent
3885local CreatorTag = WaitForChild(Rocket, 'creator')
3886
3887local Connection = nil
3888
3889-----------------
3890--| Functions |--
3891-----------------
3892
3893-- Returns the ancestor that contains a Humanoid, if it exists
3894local function FindCharacterAncestor(subject)
3895 if subject and subject ~= Workspace then
3896 local humanoid = subject:FindFirstChild('Humanoid')
3897 if humanoid then
3898 return subject, humanoid
3899 else
3900 return FindCharacterAncestor(subject.Parent)
3901 end
3902 end
3903 return nil
3904end
3905
3906local function OnExplosionHit(hitPart)
3907 if hitPart then
3908 local _, humanoid = FindCharacterAncestor(hitPart.Parent)
3909 if humanoid then
3910 humanoid.Parent:BreakJoints()
3911 local hitBindable = humanoid:FindFirstChild('Hit')
3912 if hitBindable then
3913 hitBindable:Invoke(0, CreatorTag)
3914 else
3915 print("Could not find BindableFunction 'Hit'")
3916 end
3917 end
3918 end
3919end
3920
3921local function OnTouched(otherPart)
3922 if Rocket and otherPart then
3923 -- Fly through anything in the ignore list
3924 if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
3925 return
3926 end
3927
3928 -- Fly through the creator
3929 local myPlayer = CreatorTag.Value
3930 if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
3931 return
3932 end
3933
3934 -- Create the explosion
3935 local explosion = Instance.new('Explosion')
3936 explosion.BlastPressure = BLAST_PRESSURE
3937 explosion.BlastRadius = BLAST_RADIUS
3938 explosion.Position = Rocket.Position
3939 explosion.Hit:connect(OnExplosionHit)
3940 explosion.Parent = Workspace
3941
3942 -- Start playing the boom sound
3943 local boomSound = Rocket:FindFirstChild('Boom')
3944 if boomSound then
3945 boomSound:Play()
3946 end
3947
3948 -- NOTE:
3949 -- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
3950 -- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
3951
3952 -- Stop playing the swoosh sound
3953 local swooshSound = Rocket:FindFirstChild('Swoosh')
3954 if swooshSound then
3955 swooshSound:Stop()
3956 end
3957
3958 -- Put out the fire
3959 local fire = Rocket:FindFirstChild('Fire')
3960 if fire then
3961 fire:Destroy()
3962 end
3963
3964 Rocket.Transparency = 1
3965 Rocket.CanCollide = false
3966 Rocket.Anchored = true
3967 DebrisService:AddItem(Rocket, 3)
3968
3969 -- Destroy the connection so this method won't be called again
3970 Connection:disconnect()
3971 end
3972end
3973
3974--------------------
3975--| Script Logic |--
3976--------------------
3977
3978-- Arm the rocket and save the touch connection so we can disconnect it later
3979Connection = Rocket.Touched:connect(OnTouched)
3980
3981end))
3982LocalScript72.Name = "Animation"
3983LocalScript72.Parent = Tool62
3984table.insert(cors,sandbox(LocalScript72,function()
3985--------------------
3986--| WaitForChild |--
3987--------------------
3988
3989-- Waits for parent.child to exist, then returns it
3990local function WaitForChild(parent, childName)
3991 assert(parent, "ERROR: WaitForChild: parent is nil")
3992 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3993 return parent[childName]
3994end
3995
3996-----------------
3997--| Variables |--
3998-----------------
3999
4000local Tool = script.Parent
4001
4002local FireAndReloadAnimation = WaitForChild(script, 'FireAndReload')
4003
4004local FireAndReloadTrack = nil
4005
4006-----------------
4007--| Functions |--
4008-----------------
4009
4010local function OnEquipped()
4011 local myModel = Tool.Parent
4012 local humanoid = myModel:FindFirstChild('Humanoid')
4013 if humanoid then -- Preload animations
4014 FireAndReloadTrack = humanoid:LoadAnimation(FireAndReloadAnimation)
4015 end
4016end
4017
4018local function OnChanged(property)
4019 if property == 'Enabled' and Tool.Enabled == false then
4020 -- Play fire and reload animation
4021 if FireAndReloadTrack then
4022 FireAndReloadTrack:Play()
4023 end
4024 end
4025end
4026
4027local function OnUnequipped()
4028 -- Stop animations
4029 if FireAndReloadTrack then FireAndReloadTrack:Stop() end
4030end
4031
4032--------------------
4033--| Script Logic |--
4034--------------------
4035
4036Tool.Equipped:connect(OnEquipped)
4037Tool.Changed:connect(OnChanged)
4038Tool.Unequipped:connect(OnUnequipped)
4039
4040end))
4041Animation73.Name = "FireAndReload"
4042Animation73.Parent = LocalScript72
4043Animation73.AnimationId = "http://www.roblox.com/Asset?ID=94771598"
4044LocalScript74.Name = "VisualizeReload"
4045LocalScript74.Parent = Tool62
4046table.insert(cors,sandbox(LocalScript74,function()
4047-----------------
4048--| Constants |--
4049-----------------
4050
4051local ROCKET_MESH_ID = ''
4052local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)
4053
4054local ANIM_TOTAL_TIME = 3.4 -- Total length of FireAndReload animation
4055local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
4056local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
4057
4058-----------------
4059--| Variables |--
4060-----------------
4061
4062local Tool = script.Parent
4063local ToolHandle = Tool.Handle
4064
4065local MyModel = nil
4066local ReloadRocket = nil
4067
4068local StillEquipped = false
4069
4070-----------------
4071--| Functions |--
4072-----------------
4073
4074local function MakeReloadRocket()
4075 local reloadRocket = Instance.new('Part')
4076 reloadRocket.Name = "Ammo"
4077 reloadRocket.Transparency = 1
4078 reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
4079 reloadRocket.Size = Vector3.new() -- As small as possible
4080
4081 local mesh = Instance.new('SpecialMesh', reloadRocket)
4082 mesh.MeshId = ROCKET_MESH_ID
4083 mesh.Scale = ROCKET_MESH_SCALE
4084 mesh.TextureId = ToolHandle.Mesh.TextureId
4085
4086 return reloadRocket
4087end
4088
4089local function OnEquipped()
4090 MyModel = Tool.Parent
4091 ReloadRocket = MakeReloadRocket()
4092end
4093
4094local function OnChanged(property)
4095 if property == 'Enabled' and Tool.Enabled == false then
4096 -- Show the next rocket going into the launcher
4097 StillEquipped = true
4098 wait(ROCKET_SHOW_TIME)
4099 if StillEquipped then
4100 local leftArm = MyModel:FindFirstChild('Left Arm')
4101 if leftArm then
4102 local weld = ReloadRocket:FindFirstChild('Weld')
4103 if not weld then
4104 weld = Instance.new('Weld')
4105 weld.Part0 = leftArm
4106 weld.Part1 = ReloadRocket
4107 weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
4108 weld.Parent = ReloadRocket
4109 end
4110 ReloadRocket.Parent = MyModel
4111 end
4112 wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
4113 if StillEquipped and ReloadRocket.Parent == MyModel then
4114 ReloadRocket.Parent = nil
4115 end
4116 end
4117 end
4118end
4119
4120local function OnUnequipped()
4121 StillEquipped = false
4122 ReloadRocket:Destroy()
4123 ReloadRocket = nil
4124end
4125
4126--------------------
4127--| Script Logic |--
4128--------------------
4129
4130Tool.Equipped:connect(OnEquipped)
4131Tool.Changed:connect(OnChanged)
4132Tool.Unequipped:connect(OnUnequipped)
4133
4134end))
4135Part75.Name = "RPG-7"
4136Part75.Parent = Tool62
4137Part75.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
4138Part75.CanCollide = false
4139Part75.FormFactor = Enum.FormFactor.Symmetric
4140Part75.Size = Vector3.new(1, 1, 4)
4141Part75.CFrame = CFrame.new(-71.2503738, 13.141613, 24.1718769, -0.0153171355, 0.469224393, 0.882945538, 0.00813870504, 0.883078873, -0.469153672, -0.99984926, -5.7471425e-08, -0.0173451193)
4142Part75.BottomSurface = Enum.SurfaceType.Smooth
4143Part75.TopSurface = Enum.SurfaceType.Smooth
4144Part75.Position = Vector3.new(-71.2503738, 13.141613, 24.1718769)
4145Part75.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
4146SpecialMesh76.Parent = Part75
4147SpecialMesh76.MeshId = "http://www.roblox.com/asset/?id=88742477"
4148SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
4149SpecialMesh76.TextureId = "http://www.roblox.com/asset/?id=88745396"
4150SpecialMesh76.MeshType = Enum.MeshType.FileMesh
4151SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
4152Script77.Name = "UltimateWeld"
4153Script77.Parent = Tool62
4154table.insert(cors,sandbox(Script77,function()
4155--DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
4156--The regular script is recommended
4157
4158
4159
4160--[[
4161Prevents welds from breaking/transforming when player uses the tool
4162This recreates the EXACT weld every time
4163This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new
4164ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
4165]]
4166
4167--[[Usage
41681. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
41692. Anchor all parts of tool and put inside of a tool object
41703. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
41714. Treat like normal tool, nothing special has to be done with it
4172]]
4173
4174--[[The local script included in this model can only be used if
41751. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
4176OR
41772. The weapon is previously welded (weapon can be placed in workspace and picked up then)
4178]]
4179repeat wait() until script.Parent:FindFirstChild("Handle")
4180local welds={}
4181function ClearOldWelds(tbl)
4182 for _,v in pairs(tbl) do
4183 if v:IsA('Weld') then
4184 v:Destroy()
4185 end
4186 end
4187end
4188
4189function Equipped()
4190 local handle=script.Parent:FindFirstChild('Handle')
4191 if not handle then return end
4192 local tble=handle:GetChildren()
4193 for _,v in pairs(script.Parent:GetChildren()) do
4194 if v:IsA('BasePart') and v~=handle then
4195 local c1
4196 for _1,v1 in pairs(welds) do
4197 if _1==v then
4198 c1=v1
4199 break
4200 end
4201 end
4202 if not c1 then
4203 welds[v]=v.CFrame:inverse()*handle.CFrame
4204 v.Anchored=false
4205 c1=welds[v]
4206 end
4207 local weld=Instance.new('Weld')
4208 weld.Part0=handle
4209 weld.Part1=v
4210 weld.C0=CFrame.new()
4211 weld.C1=c1
4212 weld.Parent=handle
4213 end
4214 end
4215 ClearOldWelds(tble)
4216 handle.Anchored=false
4217end
4218Equipped()
4219script.Parent.Equipped:connect(Equipped)
4220
4221--Made by DonnyTheDemented
4222
4223end))
4224Script78.Name = "Welding"
4225Script78.Parent = Tool62
4226table.insert(cors,sandbox(Script78,function()
4227function Weld(x,y)
4228 local W = Instance.new("Weld")
4229 W.Part0 = x
4230 W.Part1 = y
4231 local CJ = CFrame.new(x.Position)
4232 local C0 = x.CFrame:inverse()*CJ
4233 local C1 = y.CFrame:inverse()*CJ
4234 W.C0 = C0
4235 W.C1 = C1
4236 W.Parent = x
4237end
4238
4239function Get(A)
4240 if A.className == "Part" then
4241 Weld(script.Parent.Handle, A)
4242 A.Anchored = false
4243 else
4244 local C = A:GetChildren()
4245 for i=1, #C do
4246 Get(C[i])
4247 end
4248 end
4249end
4250
4251function Finale()
4252 Get(script.Parent)
4253end
4254
4255script.Parent.Equipped:connect(Finale)
4256script.Parent.Unequipped:connect(Finale)
4257Finale()
4258end))
4259LocalScript79.Name = "BackupWeld"
4260LocalScript79.Parent = Tool62
4261table.insert(cors,sandbox(LocalScript79,function()
4262function Weld(x,y)
4263 local W = Instance.new("Weld")
4264 W.Part0 = x
4265 W.Part1 = y
4266 local CJ = CFrame.new(x.Position)
4267 local C0 = x.CFrame:inverse()*CJ
4268 local C1 = y.CFrame:inverse()*CJ
4269 W.C0 = C0
4270 W.C1 = C1
4271 W.Parent = x
4272end
4273
4274function Get(A)
4275 if A.className == "Part" then
4276 Weld(script.Parent.Handle, A)
4277 A.Anchored = false
4278 else
4279 local C = A:GetChildren()
4280 for i=1, #C do
4281 Get(C[i])
4282 end
4283 end
4284end
4285
4286function Finale()
4287 Get(script.Parent)
4288end
4289
4290script.Parent.Equipped:connect(Finale)
4291script.Parent.Unequipped:connect(Finale)
4292Finale()
4293end))
4294LocalScript80.Name = "CameraMoveDev"
4295LocalScript80.Parent = Tool62
4296table.insert(cors,sandbox(LocalScript80,function()
4297local RunService = game:GetService('RunService')
4298local player = game.Players.LocalPlayer
4299local mouse = player:GetMouse()
4300repeat wait() until player.Character
4301repeat wait() until player.Character:FindFirstChild("Humanoid")
4302repeat wait() until player.Character:FindFirstChild("Torso")
4303local character = player.Character
4304local humanoid = character:WaitForChild("Humanoid")
4305torso = character.Torso
4306keyhold = false
4307--player.CameraMinZoomDistance = 0.5
4308lighting = true
4309haslight = false
4310
4311mouse.TargetFilter = nil
4312
4313--humanoid.JumpPower = 0
4314
4315maxcount = 100
4316runcount = maxcount
4317
4318function populateparts(mdl)
4319 if mdl:IsA("BasePart") then
4320 table.insert(parts,mdl)
4321 end
4322 for i2,mdl2 in ipairs(mdl:GetChildren()) do
4323 populateparts(mdl2)
4324 end
4325end
4326
4327function weldBetween(a, b)
4328 --Make a new Weld and Parent it to a.
4329 weld = Instance.new("ManualWeld", a)
4330 --Get the CFrame of b relative to a.
4331 weld.C0 = a.CFrame:inverse() * b.CFrame
4332 --Set the Part0 and Part1 properties respectively
4333 weld.Part0 = a
4334 weld.Part1 = b
4335 --Return the reference to the weld so that you can change it later.
4336 return weld
4337end
4338
4339humanoid.Died:connect(function()
4340 if armgroup then
4341 armgroup:Destroy()
4342 if cl then
4343 cl:Destroy()
4344 end
4345 if cl2 then
4346 cl2:Destroy()
4347 end
4348 end
4349end)
4350
4351LocalObjects = {}
4352function SetLocalTransparency(Table)
4353 for i, v in pairs(LocalObjects) do
4354 if v.Object == Table.Object then
4355 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
4356 table.remove(LocalObjects, i)
4357 end
4358 end
4359 if not Table.Transparency then
4360 return
4361 end
4362 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
4363 table.insert(LocalObjects, Table)
4364 if ModifyTransparency then
4365 ModifyTransparency:disconnect()
4366 end
4367 ModifyTransparency = RunService.RenderStepped:connect(function()
4368 for i, v in pairs(LocalObjects) do
4369 if v.Object and v.Object.Parent then
4370 local CurrentTransparency = v.Object.LocalTransparencyModifier
4371 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
4372 v.Object.LocalTransparencyModifier = v.Transparency
4373 end
4374 else
4375 table.remove(LocalObjects, i)
4376 end
4377 end
4378 end)
4379end
4380
4381local function SetupJoints()
4382 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
4383 return -- TODO: Make tracking compatible with R15
4384 end
4385 torso = character:FindFirstChild("Torso")
4386
4387 Neck = torso.Neck
4388 OldNeckC0 = Neck.C0
4389 OldNeckC1 = Neck.C1
4390 Shoulder = torso['Right Shoulder']
4391 Shoulder2 = torso['Left Shoulder']
4392 OldShoulderC0 = Shoulder.C0
4393 OldShoulderC1 = Shoulder.C1
4394 OldShoulder2C0 = Shoulder2.C0
4395 OldShoulder2C1 = Shoulder2.C1
4396end
4397
4398local function visual()
4399 if Tool then
4400 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4401 Color = Instance.new("ColorCorrectionEffect")
4402 Color.Name = "KillColor"
4403 Color.Saturation = -0.5
4404 Color.Parent = game.Workspace.CurrentCamera
4405 game.Debris:AddItem(Color, 0.22)
4406 Blur = Instance.new("BlurEffect")
4407 Blur.Name = "KillBlur"
4408 Blur.Size = 8
4409 Blur.Parent = game.Workspace.CurrentCamera
4410 game.Debris:AddItem(Blur, 0.22)
4411 Tool.GetKill:Destroy()
4412 end
4413
4414 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4415 Color = Instance.new("ColorCorrectionEffect")
4416 Color.Name = "KillColor"
4417 Color.Saturation = -0.75
4418 Color.TintColor = Color3.new(1, 0.9, 0.9)
4419 Color.Parent = game.Workspace.CurrentCamera
4420 game.Debris:AddItem(Color, 0.22)
4421 Blur = Instance.new("BlurEffect")
4422 Blur.Name = "KillBlur"
4423 Blur.Size = 8
4424 Blur.Parent = game.Workspace.CurrentCamera
4425 game.Debris:AddItem(Blur, 0.22)
4426 Tool.GetHeadKill:Destroy()
4427 end
4428 end
4429
4430 --player.CameraMode = Enum.CameraMode.LockFirstPerson
4431
4432end
4433
4434SetupJoints()
4435
4436game:GetService("RunService").RenderStepped:connect(function()
4437 if character and humanoid.Health > 0 and script.Parent.Parent == character then
4438 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
4439 Tool = character:FindFirstChildOfClass("Tool")
4440 visual()
4441 else
4442 Tool = nil
4443 end
4444 if Tool then
4445 character.Humanoid.AutoRotate = false
4446
4447 mouse.TargetFilter = game.Workspace
4448 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
4449 --game.Workspace.CurrentCamera.CameraSubject = character.Head
4450 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
4451 --end
4452
4453 character['Torso'].Neck.C0 = OldNeckC0
4454 character['Torso'].Neck.C1 = OldNeckC1
4455 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4456 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4457 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4458 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4459
4460 local toMouse = (mouse.Hit.p - character.Head.Position).unit
4461 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
4462 local neckAngle = angle
4463 if math.deg(neckAngle) > 110 then
4464 neckAngle = math.rad(110)
4465 end
4466
4467 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
4468
4469 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
4470 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
4471
4472 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
4473 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
4474 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
4475 end
4476 else
4477 if armgroup then
4478 armgroup:Destroy()
4479 armgroup = nil
4480 end
4481 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4482 character['Torso'].Neck.C0 = OldNeckC0
4483 character['Torso'].Neck.C1 = OldNeckC1
4484 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4485 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4486 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4487 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4488
4489 character.Humanoid.AutoRotate = true
4490 mouse.TargetFilter = nil
4491
4492 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4493 for i, v in pairs(character:GetChildren()) do
4494 if v:IsA("BasePart") then
4495 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4496 end
4497 if v:IsA("Accessory") then
4498 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4499 end
4500 end
4501 end
4502 end
4503 end
4504end)
4505
4506script.Parent.Unequipped:connect(function()
4507 if armgroup then
4508 armgroup:Destroy()
4509 armgroup = nil
4510 end
4511 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4512 character['Torso'].Neck.C0 = OldNeckC0
4513 character['Torso'].Neck.C1 = OldNeckC1
4514 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4515 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4516 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4517 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4518
4519 character.Humanoid.AutoRotate = true
4520 mouse.TargetFilter = nil
4521
4522 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4523 for i, v in pairs(character:GetChildren()) do
4524 if v:IsA("BasePart") then
4525 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4526 end
4527 if v:IsA("Accessory") then
4528 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4529 end
4530 end
4531 end
4532end)
4533end))
4534Tool81.Name = "Shield"
4535Tool81.Parent = mas
4536Tool81.GripPos = Vector3.new(-0.300000012, 0, -0.5)
4537Part82.Parent = Tool81
4538Part82.Material = Enum.Material.Metal
4539Part82.BrickColor = BrickColor.new("Black")
4540Part82.Rotation = Vector3.new(0, 0, -180)
4541Part82.FormFactor = Enum.FormFactor.Custom
4542Part82.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
4543Part82.CFrame = CFrame.new(14.1200104, 4.75788403, 0.600117028, -1, 0, 0, 0, -1, 0, 0, 0, 1)
4544Part82.BottomSurface = Enum.SurfaceType.Smooth
4545Part82.TopSurface = Enum.SurfaceType.Smooth
4546Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
4547Part82.Position = Vector3.new(14.1200104, 4.75788403, 0.600117028)
4548Part82.Orientation = Vector3.new(0, 0, 180)
4549Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
4550BlockMesh83.Parent = Part82
4551BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
4552BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
4553Part84.Name = "GlassPart"
4554Part84.Parent = Tool81
4555Part84.Material = Enum.Material.Glass
4556Part84.BrickColor = BrickColor.new("Institutional white")
4557Part84.Transparency = 0.5
4558Part84.Rotation = Vector3.new(0, -28.3899994, 0)
4559Part84.FormFactor = Enum.FormFactor.Custom
4560Part84.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
4561Part84.CFrame = CFrame.new(11.761734, 3.24806309, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
4562Part84.BottomSurface = Enum.SurfaceType.Smooth
4563Part84.TopSurface = Enum.SurfaceType.Smooth
4564Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
4565Part84.Position = Vector3.new(11.761734, 3.24806309, -0.0815239996)
4566Part84.Orientation = Vector3.new(0, -28.3899994, 0)
4567Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
4568BlockMesh85.Parent = Part84
4569BlockMesh85.Offset = Vector3.new(0, 0, 0.0494999997)
4570BlockMesh85.Scale = Vector3.new(1, 1, 0)
4571BlockMesh85.Scale = Vector3.new(1, 1, 0)
4572Script86.Name = "Weld"
4573Script86.Parent = Tool81
4574table.insert(cors,sandbox(Script86,function()
4575local all,last = {}
4576function scan(p)
4577 for _,v in pairs(p:GetChildren()) do
4578 if (v:IsA("BasePart")) then
4579 if (last) then
4580 local w = Instance.new("Weld")
4581 w.Part0,w.Part1 = last,v
4582 w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
4583 w.Parent = last
4584 end
4585 table.insert(all,v)
4586 last = v
4587 end
4588 scan(v)
4589 end
4590end
4591scan(script.Parent)
4592for _,v in pairs(all) do v.Anchored = false end
4593end))
4594LocalScript87.Name = "Local Gui"
4595LocalScript87.Parent = Tool81
4596table.insert(cors,sandbox(LocalScript87,function()
4597-------------------------------------
4598ToolName="Riot Shield"
4599ClipSize=1
4600ReloadTime=0.1
4601Firerate=.1
4602MinSpread=0
4603MaxSpread=0
4604SpreadRate=0.0001
4605BaseDamage=75
4606automatic=false
4607burst=false
4608shot=false
4609automacy = 0
4610run = 0
4611gaurd = 0
4612knife = 0
4613a = false
4614cam = nil
4615BarrlePos=Vector3.new(0,0,0)
4616Cursors={""}
4617ReloadCursor=""
4618-------------------------------------
4619equiped=false
4620sp=script.Parent
4621RayLength=2
4622enabled=true
4623reloading=false
4624down=false
4625r=game:service("RunService")
4626last=0
4627last2=0
4628last3=0
4629last4=0
4630last5=0
4631last6=0
4632
4633Bullet=Instance.new("Part")
4634Bullet.Name="Bullet"
4635Bullet.BrickColor=BrickColor.new("New Yeller")
4636Bullet.Anchored=true
4637Bullet.CanCollide=false
4638Bullet.Locked=true
4639Bullet.Size=Vector3.new(1,1,1)
4640Bullet.Transparency=1
4641Bullet.formFactor=0
4642Bullet.TopSurface=0
4643Bullet.BottomSurface=0
4644mesh=Instance.new("SpecialMesh")
4645mesh.Parent=Bullet
4646mesh.MeshType="Brick"
4647mesh.Name="Mesh"
4648mesh.Scale=Vector3.new(.15,.15,1)
4649
4650function check()
4651 sp.Name=ToolName
4652end
4653
4654function computeDirection(vec)
4655 local lenSquared = vec.magnitude * vec.magnitude
4656 local invSqrt = 1 / math.sqrt(lenSquared)
4657 return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
4658end
4659
4660Tool = script.Parent;
4661local arms = nil
4662local torso = nil
4663local welds = {}
4664
4665function Equip(mouse)
4666wait(0.01)
4667char = Tool.Parent
4668
4669human = char:WaitForChild("Humanoid")
4670oldhealth = human.Health
4671healthloop = human.HealthChanged:connect(function(health)
4672 if health < oldhealth then
4673human.Health = oldhealth
4674end
4675end)
4676
4677standloop = game:GetService("RunService").RenderStepped:connect(function()
4678 if human and human.Health > 0 then
4679 human.WalkSpeed = 12
4680 human.AutoRotate = true
4681 human.PlatformStand = false
4682 if char.Parent ~= workspace then
4683 char.Parent = workspace
4684 end
4685 end
4686end)
4687
4688arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
4689torso = Tool.Parent:FindFirstChild("Torso")
4690if arms ~= nil and torso ~= nil then
4691local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
4692if sh ~= nil then
4693local yes = true
4694if yes then
4695yes = false
4696sh[2].Part1 = nil
4697weld2 = Instance.new("Weld")
4698weld2.Part0 = torso
4699weld2.Parent = torso
4700weld2.Part1 = arms[2]
4701weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
4702welds[2] = weld2
4703end
4704else
4705print("sh")
4706end
4707else
4708print("arms")
4709end
4710end
4711
4712function Unequip(mouse)
4713 if standloop then
4714 human.WalkSpeed = 16
4715 standloop:disconnect()
4716 end
4717 if healthloop then
4718 healthloop:disconnect()
4719 end
4720if arms ~= nil and torso ~= nil then
4721local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
4722if sh ~= nil then
4723local yes = true
4724if yes then
4725yes = false
4726sh[2].Part1 = arms[2]
4727welds[2].Parent = nil
4728end
4729else
4730print("sh")
4731end
4732else
4733print("arms")
4734end
4735end
4736Tool.Equipped:connect(Equip)
4737Tool.Unequipped:connect(Unequip)
4738
4739
4740------------------------------------------------------------------------------------Raycasting functions
4741function cross(vector1, vector2)
4742 return Vector3.new(vector1.y * vector2.z - vector2.y * vector1.z, vector1.z * vector2.x - vector1.x * vector2.z, vector1.x * vector2.y - vector2.x * vector1.y)
4743end
4744function dot(vector1, vector2)
4745 return (vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z)
4746end
4747function getLineSphereCollide(linePoint1, lineVector, sphereCenter, radius)
4748 local a = lineVector.x * lineVector.x + lineVector.y * lineVector.y + lineVector.z * lineVector.z
4749 local b = lineVector.x * (linePoint1.x - sphereCenter.x) + lineVector.y * (linePoint1.y - sphereCenter.y) + lineVector.z * (linePoint1.z - sphereCenter.z)
4750 local c = (linePoint1.x - sphereCenter.x) * (linePoint1.x - sphereCenter.x) + (linePoint1.y - sphereCenter.y) * (linePoint1.y - sphereCenter.y) + (linePoint1.z - sphereCenter.z) * (linePoint1.z - sphereCenter.z) - radius * radius
4751 if (a > 0) and (b * b >= a * c) then
4752 local diff = math.sqrt(b * b - a * c)
4753 return ((-b - diff) / a), ((diff - b) / a)
4754 else
4755 return -1, -1
4756 end
4757end
4758--Returns hit, position, normal, time
4759function raycast(model, start, vector, brickFunction)
4760 local hit, normal, time = raycastRecursive(model, start, vector, brickFunction, vector.unit, dot(start, vector.unit))
4761 if (dot(normal, vector) > 0) then
4762 normal = -normal
4763 end
4764 return hit, start + time * vector, normal.unit, time
4765end
4766function raycastRecursive(model, start, vector, brickFunction, unitVec, startDist)
4767 if (model.className == "Part") or (model.className == "Seat") or (model.className =="SpawnLocation") then
4768 local range = model.Size.magnitude / 2
4769 local dist = dot(model.Position, unitVec) - startDist
4770 if (dist + range > 0) and (dist - range < vector.magnitude) and ((dist * unitVec + start - model.Position).magnitude < range) and brickFunction(model) then
4771 local halfSize = model.Size / 2
4772 if (model.Shape == Enum.PartType.Ball) then
4773 local time, timeMax = getLineSphereCollide(start, vector, model.Position, halfSize.x)
4774 if (time < 1) and (time >= 0) then
4775 return model, (time * vector + start - model.Position), time
4776 else
4777 return nil, Vector3.new(0, 0, 0), 1
4778 end
4779 elseif (model.Shape == Enum.PartType.Block) then
4780 local time = 1
4781 local cf = model.CFrame - model.Position
4782 local xvec = cf * Vector3.new(1, 0, 0)
4783 local yvec = cf * Vector3.new(0, 1, 0)
4784 local zvec = cf * Vector3.new(0, 0, 1)
4785 local xspd = -dot(xvec, vector)
4786 local yspd = -dot(yvec, vector)
4787 local zspd = -dot(zvec, vector)
4788 local xmin, xmax, ymin, ymax, zmin, zmax = -1
4789 local dotProd = dot(xvec, start - model.Position)
4790 if (xspd ~= 0) then
4791 xmin = (dotProd - halfSize.x) / xspd
4792 xmax = (dotProd + halfSize.x) / xspd
4793 if (xmax < xmin) then
4794 local swap = xmin
4795 xmin = xmax
4796 xmax = swap
4797 end
4798 else
4799 if (math.abs(dotProd) < halfSize.x) then
4800 xmax = 1
4801 xmin = 0
4802 else
4803 return nil, Vector3.new(0, 0, 0), 1
4804 end
4805 end
4806 local dotProd = dot(yvec, start - model.Position)
4807 if (yspd ~= 0) then
4808 ymin = (dotProd - halfSize.y) / yspd
4809 ymax = (dotProd + halfSize.y) / yspd
4810 if (ymax < ymin) then
4811 local swap = ymin
4812 ymin = ymax
4813 ymax = swap
4814 end
4815 else
4816 if (math.abs(dotProd) < halfSize.y) then
4817 ymax = 1
4818 ymin = 0
4819 else
4820 return nil, Vector3.new(0, 0, 0), 1
4821 end
4822 end
4823 local dotProd = dot(zvec, start - model.Position)
4824 if (zspd ~= 0) then
4825 zmin = (dotProd - halfSize.z) / zspd
4826 zmax = (dotProd + halfSize.z) / zspd
4827 if (zmax < zmin) then
4828 local swap = zmin
4829 zmin = zmax
4830 zmax = swap
4831 end
4832 else
4833 if (math.abs(dotProd) < halfSize.z) then
4834 zmax = 1
4835 zmin = 0
4836 else
4837 return nil, Vector3.new(0, 0, 0), 1
4838 end
4839 end
4840 if (xmin <= ymax) and (xmax >= ymin) and (xmin <= zmax) and (xmax >= zmin) and (zmin <= ymax) and (zmax >= ymin) then
4841 local normal = xvec
4842 local min = xmin
4843 if (ymin > min) then
4844 min = ymin
4845 normal = yvec
4846 end
4847 if (zmin > min) then
4848 min = zmin
4849 normal = zvec
4850 end
4851 if (min >= 0) and (min < 1) then
4852 time = min
4853 elseif (xmax > 0) and (ymax > 0) and (zmax > 0) and (min < 0) then
4854 time = 0
4855 normal = Vector3.new(0, 0, 0)
4856 end
4857 return model, normal, time
4858 else
4859 return nil, Vector3.new(0, 0, 0), 1
4860 end
4861 else -- Cylinder
4862 local time = 1
4863 local cf = model.CFrame - model.Position
4864 local xvec = cf * Vector3.new(1, 0, 0)
4865 local xspd = -dot(xvec, vector)
4866 local xmin, xmax = -1
4867 local dotProd = dot(xvec, start - model.Position)
4868 if (xspd ~= 0) then
4869 xmin = (dotProd - halfSize.x) / xspd
4870 xmax = (dotProd + halfSize.x) / xspd
4871 if (xmax < xmin) then
4872 local swap = xmin
4873 xmin = xmax
4874 xmax = swap
4875 end
4876 else
4877 if (math.abs(dotProd) < halfSize.x) then
4878 xmax = 1
4879 xmin = 0
4880 else
4881 return nil, Vector3.new(0, 0, 0), 1
4882 end
4883 end
4884
4885 local relVec = cf:pointToObjectSpace(vector) * Vector3.new(0, 1, 1)
4886 local relPos = model.CFrame:pointToObjectSpace(start) * Vector3.new(0, 1, 1)
4887 local rmin, rmax = getLineSphereCollide(relPos, relVec, Vector3.new(0, 0, 0), halfSize.y)
4888 if (xmin <= rmax) and (xmax >= rmin) and (rmax > 0) then
4889 local normal = xvec
4890 local min = xmin
4891 if (rmin > min) then
4892 min = rmin
4893 normal = cf * (relPos + relVec * min)
4894 end
4895 if (min >= 0) and (min < 1) then
4896 time = min
4897 elseif (xmax > 0) and (rmax > 0) and (min < 0) then
4898 time = 0
4899 normal = Vector3.new(0, 0, 0)
4900 end
4901 return model, normal, time
4902 else
4903 return nil, Vector3.new(0, 0, 0), 1
4904 end
4905 return nil, Vector3.new(0, 0, 0), 1
4906 end
4907 end
4908 return nil, Vector3.new(0, 0, 0), 1
4909 elseif (model.className=="Model") or (model.className=="Workspace") or (model.className=="Hat") or (model.className == "Tool") then
4910 local children=model:GetChildren()
4911 local time=1
4912 local normal=Vector3.new(0, 0, 0)
4913 local hit=nil
4914 for n = 1, #children do
4915 if children[n]~= nil then
4916 local newHit, newNormal, newTime = raycastRecursive(children[n], start, vector, brickFunction, unitVec, startDist)
4917 if (newTime < time) then
4918 time = newTime
4919 hit = newHit
4920 normal = newNormal
4921 end
4922 end
4923 end
4924 return hit, normal, time
4925 else
4926 return nil, Vector3.new(0, 0, 0), 1
4927 end
4928end
4929-------------------------------------------------------------------------------
4930
4931
4932
4933
4934
4935
4936function tagHumanoid(humanoid)
4937 local plr=game.Players:playerFromCharacter(sp.Parent)
4938 if plr~=nil then
4939 local tag=Instance.new("ObjectValue")
4940 tag.Value=plr
4941 tag.Name="creator"
4942 tag.Parent=humanoid
4943 delay(2,function()
4944 if tag~=nil then
4945 tag.Parent=nil
4946 end
4947 end)
4948 end
4949end
4950
4951
4952function reload(mouse)
4953 reloading=true
4954 while sp.Ammo.Value<ClipSize and sp.TotalAmmo.Value>0 and reloading and enabled do
4955 wait(ReloadTime/ClipSize)
4956 if reloading then
4957 check()
4958 else
4959 break
4960 end
4961 end
4962 check()
4963 mouse.Icon=Cursors[1]
4964 reloading=false
4965end
4966
4967function onKeyDown(key,mouse)
4968 key=key:lower()
4969 if key=="r" and not reloading and (sp.Ammo.Value < ClipSize) and run == 0 then
4970 reload(mouse)
4971 end
4972 if (key=="f") then
4973 if run == 0 and not reloading then
4974 enabled = false
4975 sp.Parent.Humanoid.WalkSpeed = 18
4976 weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
4977 wait(0.05)
4978 weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
4979 wait(0.05)
4980 weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
4981 wait(0.05)
4982 weld2.C1 = CFrame.new(-1, 0, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-10), 0) --(forwards/backwards,
4983 run = 1
4984 elseif run == 1 then
4985 enabled = true
4986 sp.Parent.Humanoid.WalkSpeed = 16
4987 weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
4988 wait(0.05)
4989 weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
4990 wait(0.05)
4991 weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
4992 wait(0.05)
4993 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
4994 run = 0
4995 end
4996 end
4997 end
4998
4999function movecframe(p,pos)
5000 p.Parent=game.Lighting
5001 p.Position=pos
5002 p.Parent=game.Workspace
5003end
5004
5005
5006function fire(aim)
5007 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-80), -0.02) --(forwards/backwards,
5008 wait(0.05)
5009 weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04) --(forwards/backwards,
5010 wait(0.05)
5011 weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06) --(forwards/backwards,
5012 wait(0.05)
5013 sp.Handle.Fire:Play()
5014 weld2.C1 = CFrame.new(-1.9, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-65), -0.08) --(forwards/backwards,
5015 t=r.Stepped:wait()
5016 last6=last5
5017 last5=last4
5018 last4=last3
5019 last3=last2
5020 last2=last
5021 last=t
5022 local bullet=Bullet:clone()
5023 local bt2=game.Lighting.BulletTexture:clone()
5024 bt2.BrickColor=BrickColor.new("Bright red")
5025 bt2.Mesh.Scale=Vector3.new(.5,.5,2)
5026 local totalDist=0
5027 Lengthdist=-RayLength/.5
5028 local startpoint=sp.Barrel.CFrame*BarrlePos
5029 local dir=(aim)-startpoint
5030 dir=computeDirection(dir)
5031 local cfrm=CFrame.new(startpoint, dir+startpoint)
5032 local hit,pos,normal,time=raycast(game.Workspace, startpoint, cfrm*Vector3.new(0,0,Lengthdist)-startpoint, function(brick)
5033 if brick.Name=="Glass" then
5034 return true
5035 elseif brick.Name=="Bullet" or brick.Name=="BulletTexture" then
5036 return false
5037 elseif brick.ClassName=="Hat" then
5038 return false
5039 elseif brick.Parent.ClassName=="Hat" then
5040 return false
5041 elseif brick:IsDescendantOf(sp.Parent) then
5042 return false
5043 elseif brick.Name=="Handle" then
5044 if brick.Parent:IsDescendantOf(sp.Parent) then
5045 return false
5046 else
5047 return true
5048 end
5049 end
5050 return true
5051 end)
5052 bullet.Parent=game.Workspace
5053 bt2.Parent=game.Workspace
5054 if hit~=nil then
5055 local humanoid=hit.Parent:FindFirstChild("Humanoid")
5056 if humanoid~=nil then
5057 local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25))
5058 if hit.Name=="Head" then
5059 damage=damage*1.25
5060 elseif hit.Name=="Torso" then
5061 else
5062 damage=damage*.75
5063 end
5064 if humanoid.Health>0 then
5065 local eplr=game.Players:playerFromCharacter(humanoid.Parent)
5066 local plr=game.Players:playerFromCharacter(sp.Parent)
5067 if eplr~=nil and plr~=nil then
5068 -- if eplr.TeamColor~=plr.TeamColor or eplr.Neutral or plr.Neutral then
5069 tagHumanoid(humanoid)
5070 humanoid:TakeDamage(damage)
5071 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
5072 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
5073 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
5074 wait(0.01)
5075 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5076 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5077 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5078
5079 -- end
5080 else
5081 tagHumanoid(humanoid)
5082 humanoid:TakeDamage(damage)
5083 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
5084 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
5085 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
5086 wait(0.01)
5087 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5088 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5089 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5090 end
5091 end
5092 end
5093
5094 if (hit.Name == "Ice") or (hit.Name == "Glass") then
5095 rand = math.random(1,5)
5096 if rand == 3 then
5097 workspace.GlassSound:play()
5098 hit:breakJoints()
5099 end
5100 end
5101 if (hit.Parent:findFirstChild("Hit")) then
5102 hit.Parent.Health.Value = hit.Parent.Health.Value - BaseDamage/20
5103 end
5104 distance=(startpoint-pos).magnitude
5105 bullet.CFrame=cfrm*CFrame.new(0,0,-distance/2)
5106 bullet.Mesh.Scale=Vector3.new(.15,.15,distance)
5107 else
5108 bullet.CFrame=cfrm*CFrame.new(0,0,-RayLength/2)
5109 bullet.Mesh.Scale=Vector3.new(.15,.15,RayLength)
5110 end
5111 if pos~=nil then
5112 bt2.CFrame=bullet.CFrame
5113 movecframe(bt2,pos)
5114 end
5115 local deb=game:FindFirstChild("Debris")
5116 if deb==nil then
5117 local debris=Instance.new("Debris")
5118 debris.Parent=game
5119 end
5120 check()
5121 game.Debris:AddItem(bullet,.05)
5122 game.Debris:AddItem(bt2,.5)
5123end
5124
5125function onButton1Up(mouse)
5126 down=false
5127end
5128
5129function onButton1Down(mouse)
5130 h=sp.Parent:FindFirstChild("Humanoid")
5131 if not enabled or reloading or down or h==nil then
5132 return
5133 end
5134 if sp.Ammo.Value>0 and h.Health>0 then
5135 --[[if sp.Ammo.Value<=0 then
5136 if not reloading then
5137 reload(mouse)
5138 end
5139 return
5140 end]]
5141 down=true
5142 enabled=false
5143 while down do
5144 if sp.Ammo.Value<=0 then
5145 break
5146 end
5147 if burst then
5148 local startpoint=sp.Barrel.CFrame*BarrlePos
5149 local mag=(mouse.Hit.p-startpoint).magnitude
5150 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5151 fire(mouse.Hit.p+rndm)
5152 sp.Ammo.Value=sp.Ammo.Value-1
5153 if sp.Ammo.Value<=0 then
5154 break
5155 end
5156 wait(.05)
5157 local startpoint=sp.Barrel.CFrame*BarrlePos
5158 local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
5159 local rndm2=Vector3.new(math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2))
5160 fire(mouse.Hit.p+rndm+rndm2)
5161 sp.Ammo.Value=sp.Ammo.Value-1
5162 if sp.Ammo.Value<=0 then
5163 break
5164 end
5165 wait(.05)
5166 fire(mouse.Hit.p+rndm+rndm2+rndm2)
5167 sp.Ammo.Value=sp.Ammo.Value-1
5168 elseif shot then
5169 sp.Ammo.Value=sp.Ammo.Value-1
5170 local startpoint=sp.Barrel.CFrame*BarrlePos
5171 local mag=(mouse.Hit.p-startpoint).magnitude
5172 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5173 fire(mouse.Hit.p+rndm)
5174 local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
5175 local rndm2=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5176 fire(mouse.Hit.p+rndm+rndm2)
5177 local rndm3=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5178 fire(mouse.Hit.p+rndm+rndm3)
5179 local rndm4=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5180 fire(mouse.Hit.p+rndm+rndm4)
5181 else
5182 local startpoint=sp.Barrel.CFrame*BarrlePos
5183 local mag=(mouse.Hit.p-startpoint).magnitude
5184 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5185 fire(mouse.Hit.p+rndm)
5186 weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06) --(forwards/backwards,
5187 wait(0.05)
5188 weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04) --(forwards/backwards,
5189 wait(0.05)
5190 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
5191 end
5192 wait(Firerate)
5193 if not automatic then
5194 break
5195 end
5196 end
5197 enabled=true
5198 else
5199 sp.Handle.Trigger:Play()
5200 sp.GripForward = Vector3.new(-0.243, -0.1, -0.97)
5201 wait(0.1)
5202 sp.GripForward = Vector3.new(-0.243, 0, -0.97)
5203 end
5204end
5205
5206function onEquippedLocal(mouse)
5207 if mouse==nil then
5208 print("Mouse not found")
5209 return
5210 end
5211 mouse.Icon=Cursors[1]
5212 mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
5213 mouse.Button1Down:connect(function() onButton1Down(mouse) end)
5214 mouse.Button1Up:connect(function() onButton1Up(mouse) end)
5215 check()
5216 equiped=true
5217 if #Cursors>1 then
5218 while equiped do
5219 t=r.Stepped:wait()
5220 local action=sp.Parent:FindFirstChild("Pose")
5221 if action~=nil then
5222 if sp.Parent.Pose.Value=="Standing" then
5223 Spread=MinSpread
5224 else
5225 Spread=MinSpread+((4/10)*(MaxSpread-MinSpread))
5226 end
5227 else
5228 Spread=MinSpread
5229 end
5230 if t-last<SpreadRate then
5231 Spread=Spread+.1*(MaxSpread-MinSpread)
5232 end
5233 if t-last2<SpreadRate then
5234 Spread=Spread+.1*(MaxSpread-MinSpread)
5235 end
5236 if t-last3<SpreadRate then
5237 Spread=Spread+.1*(MaxSpread-MinSpread)
5238 end
5239 if t-last4<SpreadRate then
5240 Spread=Spread+.1*(MaxSpread-MinSpread)
5241 end
5242 if t-last5<SpreadRate then
5243 Spread=Spread+.1*(MaxSpread-MinSpread)
5244 end
5245 if t-last6<SpreadRate then
5246 Spread=Spread+.1*(MaxSpread-MinSpread)
5247 end
5248 if not reloading then
5249 local percent=(Spread-MinSpread)/(MaxSpread-MinSpread)
5250 for i=0,#Cursors-1 do
5251 if percent>(i/(#Cursors-1))-((1/(#Cursors-1))/2) and percent<(i/(#Cursors-1))+((1/(#Cursors-1))/2) then
5252 mouse.Icon=Cursors[i+1]
5253 end
5254 end
5255 end
5256 wait(Firerate*.9)
5257 end
5258 end
5259end
5260function onUnequippedLocal(mouse)
5261 equiped=false
5262 reloading=false
5263 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5264 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5265 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5266 sp.Spread = 0
5267 sp.Parent.Humanoid.WalkSpeed = 16
5268 ADS = 0
5269 run = 0
5270end
5271sp.Equipped:connect(onEquippedLocal)
5272sp.Unequipped:connect(onUnequippedLocal)
5273check()
5274end))
5275Part88.Parent = Tool81
5276Part88.Material = Enum.Material.Metal
5277Part88.BrickColor = BrickColor.new("Black")
5278Part88.Rotation = Vector3.new(-90, 0, 71.0699997)
5279Part88.FormFactor = Enum.FormFactor.Custom
5280Part88.Size = Vector3.new(0.25, 0.200000003, 0.25)
5281Part88.CFrame = CFrame.new(13.3802023, 4.75810814, 0.172626004, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
5282Part88.BottomSurface = Enum.SurfaceType.Smooth
5283Part88.TopSurface = Enum.SurfaceType.Smooth
5284Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
5285Part88.Position = Vector3.new(13.3802023, 4.75810814, 0.172626004)
5286Part88.Orientation = Vector3.new(-90, 71.0699997, 0)
5287Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
5288CylinderMesh89.Parent = Part88
5289CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
5290CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
5291Part90.Name = "GlassPart"
5292Part90.Parent = Tool81
5293Part90.Material = Enum.Material.Glass
5294Part90.BrickColor = BrickColor.new("Institutional white")
5295Part90.Transparency = 0.5
5296Part90.Rotation = Vector3.new(0, -37.8499985, 0)
5297Part90.FormFactor = Enum.FormFactor.Custom
5298Part90.Size = Vector3.new(0.400000006, 2, 0.200000003)
5299Part90.CFrame = CFrame.new(11.3907623, 3.37725711, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5300Part90.BottomSurface = Enum.SurfaceType.Smooth
5301Part90.TopSurface = Enum.SurfaceType.Smooth
5302Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
5303Part90.Position = Vector3.new(11.3907623, 3.37725711, -0.318569005)
5304Part90.Orientation = Vector3.new(0, -37.8499985, 0)
5305Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
5306BlockMesh91.Parent = Part90
5307BlockMesh91.Offset = Vector3.new(0, 0, 0.0494999997)
5308BlockMesh91.Scale = Vector3.new(1, 1, 0)
5309BlockMesh91.Scale = Vector3.new(1, 1, 0)
5310Part92.Name = "GlassPart"
5311Part92.Parent = Tool81
5312Part92.Material = Enum.Material.Glass
5313Part92.BrickColor = BrickColor.new("Institutional white")
5314Part92.Transparency = 0.5
5315Part92.Rotation = Vector3.new(-180, -90, 0)
5316Part92.FormFactor = Enum.FormFactor.Custom
5317Part92.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5318Part92.CFrame = CFrame.new(14.1699362, 2.27702403, 0.649676979, -0.000118972122, -4.31590597e-05, -1, 2.79581602e-09, -1, 4.31590597e-05, -0.99999994, 2.33890907e-09, 0.00011897213)
5319Part92.BottomSurface = Enum.SurfaceType.Smooth
5320Part92.TopSurface = Enum.SurfaceType.Smooth
5321Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
5322Part92.Position = Vector3.new(14.1699362, 2.27702403, 0.649676979)
5323Part92.Orientation = Vector3.new(0, -89.9899979, 180)
5324Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
5325SpecialMesh93.Parent = Part92
5326SpecialMesh93.Scale = Vector3.new(0, 1, 1)
5327SpecialMesh93.MeshType = Enum.MeshType.Wedge
5328SpecialMesh93.Scale = Vector3.new(0, 1, 1)
5329Part94.Parent = Tool81
5330Part94.Material = Enum.Material.Metal
5331Part94.BrickColor = BrickColor.new("Black")
5332Part94.Rotation = Vector3.new(0, -28.3899994, 0)
5333Part94.FormFactor = Enum.FormFactor.Custom
5334Part94.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5335Part94.CFrame = CFrame.new(11.9849997, 6.51584816, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5336Part94.BottomSurface = Enum.SurfaceType.Smooth
5337Part94.TopSurface = Enum.SurfaceType.Smooth
5338Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
5339Part94.Position = Vector3.new(11.9849997, 6.51584816, 0.0920599997)
5340Part94.Orientation = Vector3.new(0, -28.3899994, 0)
5341Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
5342BlockMesh95.Parent = Part94
5343BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
5344BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
5345Part96.Parent = Tool81
5346Part96.Material = Enum.Material.Metal
5347Part96.BrickColor = BrickColor.new("Black")
5348Part96.Rotation = Vector3.new(0, -37.8400002, 135)
5349Part96.FormFactor = Enum.FormFactor.Custom
5350Part96.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
5351Part96.CFrame = CFrame.new(11.2934103, 6.38909388, -0.394008994, -0.558394432, -0.558437765, -0.613467932, 0.707113028, -0.707100511, 3.85237654e-05, -0.433805048, -0.433769733, 0.789719641)
5352Part96.BottomSurface = Enum.SurfaceType.Smooth
5353Part96.TopSurface = Enum.SurfaceType.Smooth
5354Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
5355Part96.Position = Vector3.new(11.2934103, 6.38909388, -0.394008994)
5356Part96.Orientation = Vector3.new(0, -37.8400002, 135)
5357Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
5358BlockMesh97.Parent = Part96
5359BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
5360BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
5361Part98.Parent = Tool81
5362Part98.Material = Enum.Material.Metal
5363Part98.BrickColor = BrickColor.new("Black")
5364Part98.Rotation = Vector3.new(0, -37.8499985, 0)
5365Part98.FormFactor = Enum.FormFactor.Custom
5366Part98.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5367Part98.CFrame = CFrame.new(11.5745382, 6.51584816, -0.175518006, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5368Part98.BottomSurface = Enum.SurfaceType.Smooth
5369Part98.TopSurface = Enum.SurfaceType.Smooth
5370Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
5371Part98.Position = Vector3.new(11.5745382, 6.51584816, -0.175518006)
5372Part98.Orientation = Vector3.new(0, -37.8499985, 0)
5373Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
5374BlockMesh99.Parent = Part98
5375BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
5376BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
5377Part100.Name = "GlassPart"
5378Part100.Parent = Tool81
5379Part100.Material = Enum.Material.Glass
5380Part100.BrickColor = BrickColor.new("Institutional white")
5381Part100.Transparency = 0.5
5382Part100.Rotation = Vector3.new(0, -37.8499985, 0)
5383Part100.FormFactor = Enum.FormFactor.Custom
5384Part100.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5385Part100.CFrame = CFrame.new(11.4696798, 6.3552742, -0.257061005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5386Part100.BottomSurface = Enum.SurfaceType.Smooth
5387Part100.TopSurface = Enum.SurfaceType.Smooth
5388Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
5389Part100.Position = Vector3.new(11.4696798, 6.3552742, -0.257061005)
5390Part100.Orientation = Vector3.new(0, -37.8499985, 0)
5391Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
5392BlockMesh101.Parent = Part100
5393BlockMesh101.Offset = Vector3.new(0, 0, 0.0494999997)
5394BlockMesh101.Scale = Vector3.new(1, 1, 0)
5395BlockMesh101.Scale = Vector3.new(1, 1, 0)
5396Part102.Name = "GlassPart"
5397Part102.Parent = Tool81
5398Part102.Material = Enum.Material.Glass
5399Part102.BrickColor = BrickColor.new("Institutional white")
5400Part102.Transparency = 0.5
5401Part102.Rotation = Vector3.new(90, 0.00999999978, 127.839996)
5402Part102.FormFactor = Enum.FormFactor.Custom
5403Part102.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5404Part102.CFrame = CFrame.new(11.2810202, 6.34355021, -0.340312988, -0.613507092, -0.789689183, 0.000104060433, -8.34418415e-07, -0.000131125649, -1, 0.789689183, -0.613507152, 7.97875909e-05)
5405Part102.BottomSurface = Enum.SurfaceType.Smooth
5406Part102.TopSurface = Enum.SurfaceType.Smooth
5407Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
5408Part102.Position = Vector3.new(11.2810202, 6.34355021, -0.340312988)
5409Part102.Orientation = Vector3.new(90, -127.839996, 0)
5410Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
5411SpecialMesh103.Parent = Part102
5412SpecialMesh103.Scale = Vector3.new(0, 1, 1)
5413SpecialMesh103.MeshType = Enum.MeshType.Wedge
5414SpecialMesh103.Scale = Vector3.new(0, 1, 1)
5415Part104.Name = "GlassPart"
5416Part104.Parent = Tool81
5417Part104.Material = Enum.Material.Glass
5418Part104.BrickColor = BrickColor.new("Institutional white")
5419Part104.Transparency = 0.5
5420Part104.Rotation = Vector3.new(0, -37.8499985, 0)
5421Part104.FormFactor = Enum.FormFactor.Custom
5422Part104.Size = Vector3.new(0.400000006, 1.06050003, 0.200000003)
5423Part104.CFrame = CFrame.new(11.3907003, 5.71331215, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5424Part104.BottomSurface = Enum.SurfaceType.Smooth
5425Part104.TopSurface = Enum.SurfaceType.Smooth
5426Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
5427Part104.Position = Vector3.new(11.3907003, 5.71331215, -0.318569005)
5428Part104.Orientation = Vector3.new(0, -37.8499985, 0)
5429Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
5430BlockMesh105.Parent = Part104
5431BlockMesh105.Offset = Vector3.new(0, 0, 0.0494999997)
5432BlockMesh105.Scale = Vector3.new(1, 1, 0)
5433BlockMesh105.Scale = Vector3.new(1, 1, 0)
5434Part106.Name = "GlassPart"
5435Part106.Parent = Tool81
5436Part106.Material = Enum.Material.Glass
5437Part106.BrickColor = BrickColor.new("Institutional white")
5438Part106.Transparency = 0.5
5439Part106.Rotation = Vector3.new(0, -28.3899994, 0)
5440Part106.FormFactor = Enum.FormFactor.Custom
5441Part106.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
5442Part106.CFrame = CFrame.new(11.761672, 5.8180418, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5443Part106.BottomSurface = Enum.SurfaceType.Smooth
5444Part106.TopSurface = Enum.SurfaceType.Smooth
5445Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
5446Part106.Position = Vector3.new(11.761672, 5.8180418, -0.0815239996)
5447Part106.Orientation = Vector3.new(0, -28.3899994, 0)
5448Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
5449BlockMesh107.Parent = Part106
5450BlockMesh107.Offset = Vector3.new(0, 0, 0.0494999997)
5451BlockMesh107.Scale = Vector3.new(1, 1, 0)
5452BlockMesh107.Scale = Vector3.new(1, 1, 0)
5453Part108.Parent = Tool81
5454Part108.Material = Enum.Material.Metal
5455Part108.BrickColor = BrickColor.new("Black")
5456Part108.Rotation = Vector3.new(0, -9.46000004, 0)
5457Part108.FormFactor = Enum.FormFactor.Custom
5458Part108.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5459Part108.CFrame = CFrame.new(13.3487082, 6.51590919, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5460Part108.BottomSurface = Enum.SurfaceType.Smooth
5461Part108.TopSurface = Enum.SurfaceType.Smooth
5462Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
5463Part108.Position = Vector3.new(13.3487082, 6.51590919, 0.559585989)
5464Part108.Orientation = Vector3.new(0, -9.46000004, 0)
5465Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
5466BlockMesh109.Parent = Part108
5467BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
5468BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
5469Part110.Parent = Tool81
5470Part110.Material = Enum.Material.Metal
5471Part110.BrickColor = BrickColor.new("Black")
5472Part110.FormFactor = Enum.FormFactor.Custom
5473Part110.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5474Part110.CFrame = CFrame.new(13.8371124, 6.51590919, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5475Part110.BottomSurface = Enum.SurfaceType.Smooth
5476Part110.TopSurface = Enum.SurfaceType.Smooth
5477Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
5478Part110.Position = Vector3.new(13.8371124, 6.51590919, 0.600117028)
5479Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
5480BlockMesh111.Parent = Part110
5481BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
5482BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
5483Part112.Parent = Tool81
5484Part112.Material = Enum.Material.Metal
5485Part112.BrickColor = BrickColor.new("Black")
5486Part112.Rotation = Vector3.new(0, -37.8499985, 0)
5487Part112.FormFactor = Enum.FormFactor.Custom
5488Part112.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
5489Part112.CFrame = CFrame.new(11.1933136, 5.73304176, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5490Part112.BottomSurface = Enum.SurfaceType.Smooth
5491Part112.TopSurface = Enum.SurfaceType.Smooth
5492Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
5493Part112.Position = Vector3.new(11.1933136, 5.73304176, -0.471935004)
5494Part112.Orientation = Vector3.new(0, -37.8499985, 0)
5495Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
5496BlockMesh113.Parent = Part112
5497BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
5498BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
5499Part114.Parent = Tool81
5500Part114.Material = Enum.Material.Metal
5501Part114.BrickColor = BrickColor.new("Black")
5502Part114.Rotation = Vector3.new(0, -18.9300003, 0)
5503Part114.FormFactor = Enum.FormFactor.Custom
5504Part114.Size = Vector3.new(0.966000438, 0.200000003, 0.200000003)
5505Part114.CFrame = CFrame.new(12.6531525, 6.51590919, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
5506Part114.BottomSurface = Enum.SurfaceType.Smooth
5507Part114.TopSurface = Enum.SurfaceType.Smooth
5508Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
5509Part114.Position = Vector3.new(12.6531525, 6.51590919, 0.364033014)
5510Part114.Orientation = Vector3.new(0, -18.9300003, 0)
5511Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
5512BlockMesh115.Parent = Part114
5513BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
5514BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
5515Part116.Name = "GlassPart"
5516Part116.Parent = Tool81
5517Part116.Material = Enum.Material.Glass
5518Part116.BrickColor = BrickColor.new("Institutional white")
5519Part116.Transparency = 0.5
5520Part116.Rotation = Vector3.new(0, -90, 0)
5521Part116.FormFactor = Enum.FormFactor.Custom
5522Part116.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5523Part116.CFrame = CFrame.new(14.1699362, 6.34361982, 0.64991802, -3.26636837e-05, 4.31581502e-05, -1, 9.29513244e-10, 1, 4.31581502e-05, 0.99999994, 4.80190998e-10, -3.26636873e-05)
5524Part116.BottomSurface = Enum.SurfaceType.Smooth
5525Part116.TopSurface = Enum.SurfaceType.Smooth
5526Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
5527Part116.Position = Vector3.new(14.1699362, 6.34361982, 0.64991802)
5528Part116.Orientation = Vector3.new(0, -90, 0)
5529Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
5530SpecialMesh117.Parent = Part116
5531SpecialMesh117.Scale = Vector3.new(0, 1, 1)
5532SpecialMesh117.MeshType = Enum.MeshType.Wedge
5533SpecialMesh117.Scale = Vector3.new(0, 1, 1)
5534Part118.Name = "GlassPart"
5535Part118.Parent = Tool81
5536Part118.Material = Enum.Material.Glass
5537Part118.BrickColor = BrickColor.new("Institutional white")
5538Part118.Transparency = 0.5
5539Part118.Rotation = Vector3.new(0, -18.9200001, 0)
5540Part118.FormFactor = Enum.FormFactor.Custom
5541Part118.Size = Vector3.new(1.5, 1.29999995, 0.200000003)
5542Part118.CFrame = CFrame.new(12.6835442, 5.81983423, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5543Part118.BottomSurface = Enum.SurfaceType.Smooth
5544Part118.TopSurface = Enum.SurfaceType.Smooth
5545Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
5546Part118.Position = Vector3.new(12.6835442, 5.81983423, 0.277363002)
5547Part118.Orientation = Vector3.new(0, -18.9200001, 0)
5548Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
5549BlockMesh119.Parent = Part118
5550BlockMesh119.Offset = Vector3.new(0, 0, 0.0494999997)
5551BlockMesh119.Scale = Vector3.new(1, 1, 0)
5552BlockMesh119.Scale = Vector3.new(1, 1, 0)
5553Part120.Parent = Tool81
5554Part120.Material = Enum.Material.Metal
5555Part120.BrickColor = BrickColor.new("Black")
5556Part120.Rotation = Vector3.new(0, 0, -135)
5557Part120.FormFactor = Enum.FormFactor.Custom
5558Part120.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
5559Part120.CFrame = CFrame.new(14.1931915, 6.38920021, 0.600117028, -0.707149565, 0.707063973, 7.29076783e-05, -0.707063973, -0.707149565, 6.32290612e-05, 9.62636259e-05, -6.83798817e-06, 1)
5560Part120.BottomSurface = Enum.SurfaceType.Smooth
5561Part120.TopSurface = Enum.SurfaceType.Smooth
5562Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
5563Part120.Position = Vector3.new(14.1931915, 6.38920021, 0.600117028)
5564Part120.Orientation = Vector3.new(0, 0, -135)
5565Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
5566BlockMesh121.Parent = Part120
5567BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
5568BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
5569Part122.Name = "GlassPart"
5570Part122.Parent = Tool81
5571Part122.Material = Enum.Material.Glass
5572Part122.BrickColor = BrickColor.new("Institutional white")
5573Part122.Transparency = 0.5
5574Part122.FormFactor = Enum.FormFactor.Custom
5575Part122.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5576Part122.CFrame = CFrame.new(13.969986, 6.35533524, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5577Part122.BottomSurface = Enum.SurfaceType.Smooth
5578Part122.TopSurface = Enum.SurfaceType.Smooth
5579Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
5580Part122.Position = Vector3.new(13.969986, 6.35533524, 0.600117028)
5581Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
5582BlockMesh123.Parent = Part122
5583BlockMesh123.Offset = Vector3.new(0, 0, 0.0494999997)
5584BlockMesh123.Scale = Vector3.new(1, 1, 0)
5585BlockMesh123.Scale = Vector3.new(1, 1, 0)
5586Part124.Name = "GlassPart"
5587Part124.Parent = Tool81
5588Part124.Material = Enum.Material.Glass
5589Part124.BrickColor = BrickColor.new("Institutional white")
5590Part124.Transparency = 0.5
5591Part124.FormFactor = Enum.FormFactor.Custom
5592Part124.Size = Vector3.new(0.400000006, 1.06050014, 0.200000003)
5593Part124.CFrame = CFrame.new(14.0699615, 5.71336222, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5594Part124.BottomSurface = Enum.SurfaceType.Smooth
5595Part124.TopSurface = Enum.SurfaceType.Smooth
5596Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
5597Part124.Position = Vector3.new(14.0699615, 5.71336222, 0.600117028)
5598Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
5599BlockMesh125.Parent = Part124
5600BlockMesh125.Offset = Vector3.new(0, 0, 0.0494999997)
5601BlockMesh125.Scale = Vector3.new(1, 1, 0)
5602BlockMesh125.Scale = Vector3.new(1, 1, 0)
5603Part126.Name = "Barrel"
5604Part126.Parent = Tool81
5605Part126.Material = Enum.Material.Metal
5606Part126.BrickColor = BrickColor.new("Black")
5607Part126.Rotation = Vector3.new(0, -18.9200001, 0)
5608Part126.FormFactor = Enum.FormFactor.Custom
5609Part126.Size = Vector3.new(1.5, 0.850000024, 0.200000003)
5610Part126.CFrame = CFrame.new(12.6835442, 4.75803518, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5611Part126.BottomSurface = Enum.SurfaceType.Smooth
5612Part126.TopSurface = Enum.SurfaceType.Smooth
5613Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
5614Part126.Position = Vector3.new(12.6835442, 4.75803518, 0.277363002)
5615Part126.Orientation = Vector3.new(0, -18.9200001, 0)
5616Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
5617BlockMesh127.Parent = Part126
5618BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
5619BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
5620Decal128.Parent = Part126
5621Decal128.Texture = "http://www.roblox.com/asset/?id=156639788"
5622Decal128.Face = Enum.NormalId.Back
5623Part129.Parent = Tool81
5624Part129.Material = Enum.Material.Metal
5625Part129.BrickColor = BrickColor.new("Black")
5626Part129.Rotation = Vector3.new(0, -28.3899994, 0)
5627Part129.FormFactor = Enum.FormFactor.Custom
5628Part129.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5629Part129.CFrame = CFrame.new(11.761734, 4.75803518, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5630Part129.BottomSurface = Enum.SurfaceType.Smooth
5631Part129.TopSurface = Enum.SurfaceType.Smooth
5632Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
5633Part129.Position = Vector3.new(11.761734, 4.75803518, -0.0815239996)
5634Part129.Orientation = Vector3.new(0, -28.3899994, 0)
5635Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
5636BlockMesh130.Parent = Part129
5637BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
5638BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
5639Part131.Parent = Tool81
5640Part131.Material = Enum.Material.Metal
5641Part131.BrickColor = BrickColor.new("Black")
5642Part131.Rotation = Vector3.new(-90, 0, 71.0699997)
5643Part131.FormFactor = Enum.FormFactor.Custom
5644Part131.Size = Vector3.new(0.25, 0.200000003, 0.25)
5645Part131.CFrame = CFrame.new(12.1975861, 4.75803518, -0.232890993, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
5646Part131.BottomSurface = Enum.SurfaceType.Smooth
5647Part131.TopSurface = Enum.SurfaceType.Smooth
5648Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
5649Part131.Position = Vector3.new(12.1975861, 4.75803518, -0.232890993)
5650Part131.Orientation = Vector3.new(-90, 71.0699997, 0)
5651Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
5652CylinderMesh132.Parent = Part131
5653CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
5654CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
5655Part133.Parent = Tool81
5656Part133.Material = Enum.Material.Metal
5657Part133.BrickColor = BrickColor.new("Black")
5658Part133.Rotation = Vector3.new(0, -37.8499985, 0)
5659Part133.FormFactor = Enum.FormFactor.Custom
5660Part133.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5661Part133.CFrame = CFrame.new(11.3512716, 4.75803518, -0.34910199, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5662Part133.BottomSurface = Enum.SurfaceType.Smooth
5663Part133.TopSurface = Enum.SurfaceType.Smooth
5664Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
5665Part133.Position = Vector3.new(11.3512716, 4.75803518, -0.34910199)
5666Part133.Orientation = Vector3.new(0, -37.8499985, 0)
5667Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
5668BlockMesh134.Parent = Part133
5669BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
5670BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
5671Part135.Name = "GlassPart"
5672Part135.Parent = Tool81
5673Part135.Material = Enum.Material.Glass
5674Part135.BrickColor = BrickColor.new("Institutional white")
5675Part135.Transparency = 0.5
5676Part135.Rotation = Vector3.new(0, -9.46000004, 0)
5677Part135.FormFactor = Enum.FormFactor.Custom
5678Part135.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
5679Part135.CFrame = CFrame.new(13.6316061, 5.81809902, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5680Part135.BottomSurface = Enum.SurfaceType.Smooth
5681Part135.TopSurface = Enum.SurfaceType.Smooth
5682Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
5683Part135.Position = Vector3.new(13.6316061, 5.81809902, 0.559585989)
5684Part135.Orientation = Vector3.new(0, -9.46000004, 0)
5685Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
5686BlockMesh136.Parent = Part135
5687BlockMesh136.Offset = Vector3.new(0, 0, 0.0494999997)
5688BlockMesh136.Scale = Vector3.new(1, 1, 0)
5689BlockMesh136.Scale = Vector3.new(1, 1, 0)
5690Part137.Parent = Tool81
5691Part137.Material = Enum.Material.Metal
5692Part137.BrickColor = BrickColor.new("Black")
5693Part137.FormFactor = Enum.FormFactor.Custom
5694Part137.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
5695Part137.CFrame = CFrame.new(14.3199615, 5.73314905, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5696Part137.BottomSurface = Enum.SurfaceType.Smooth
5697Part137.TopSurface = Enum.SurfaceType.Smooth
5698Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
5699Part137.Position = Vector3.new(14.3199615, 5.73314905, 0.600117028)
5700Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
5701BlockMesh138.Parent = Part137
5702BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
5703BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
5704Part139.Parent = Tool81
5705Part139.Material = Enum.Material.Metal
5706Part139.BrickColor = BrickColor.new("Black")
5707Part139.Rotation = Vector3.new(0, -9.46000004, 0)
5708Part139.FormFactor = Enum.FormFactor.Custom
5709Part139.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5710Part139.CFrame = CFrame.new(13.6316061, 4.75810814, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5711Part139.BottomSurface = Enum.SurfaceType.Smooth
5712Part139.TopSurface = Enum.SurfaceType.Smooth
5713Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
5714Part139.Position = Vector3.new(13.6316061, 4.75810814, 0.559585989)
5715Part139.Orientation = Vector3.new(0, -9.46000004, 0)
5716Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
5717BlockMesh140.Parent = Part139
5718BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
5719BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
5720Part141.Parent = Tool81
5721Part141.Material = Enum.Material.Metal
5722Part141.BrickColor = BrickColor.new("Black")
5723Part141.Rotation = Vector3.new(0, -37.8499985, 0)
5724Part141.FormFactor = Enum.FormFactor.Custom
5725Part141.Size = Vector3.new(0.200000003, 2, 0.200000003)
5726Part141.CFrame = CFrame.new(11.1933403, 3.3330729, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5727Part141.BottomSurface = Enum.SurfaceType.Smooth
5728Part141.TopSurface = Enum.SurfaceType.Smooth
5729Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
5730Part141.Position = Vector3.new(11.1933403, 3.3330729, -0.471935004)
5731Part141.Orientation = Vector3.new(0, -37.8499985, 0)
5732Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
5733BlockMesh142.Parent = Part141
5734BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
5735BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
5736Part143.Name = "GlassPart"
5737Part143.Parent = Tool81
5738Part143.Material = Enum.Material.Glass
5739Part143.BrickColor = BrickColor.new("Institutional white")
5740Part143.Transparency = 0.5
5741Part143.FormFactor = Enum.FormFactor.Custom
5742Part143.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5743Part143.CFrame = CFrame.new(13.9701042, 2.26522803, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5744Part143.BottomSurface = Enum.SurfaceType.Smooth
5745Part143.TopSurface = Enum.SurfaceType.Smooth
5746Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
5747Part143.Position = Vector3.new(13.9701042, 2.26522803, 0.599873006)
5748Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
5749BlockMesh144.Parent = Part143
5750BlockMesh144.Offset = Vector3.new(0, 0, 0.0494999997)
5751BlockMesh144.Scale = Vector3.new(1, 1, 0)
5752BlockMesh144.Scale = Vector3.new(1, 1, 0)
5753Part145.Parent = Tool81
5754Part145.Material = Enum.Material.Metal
5755Part145.BrickColor = BrickColor.new("Black")
5756Part145.Rotation = Vector3.new(90.0099945, -45.0099983, 90)
5757Part145.FormFactor = Enum.FormFactor.Custom
5758Part145.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
5759Part145.CFrame = CFrame.new(14.1933136, 2.22689891, 0.599873006, -1.09672546e-05, -0.707021356, -0.707198203, -9.6231699e-05, 0.707193971, -0.707021356, 1.00000417, 6.32703304e-05, -7.7009201e-05)
5760Part145.BottomSurface = Enum.SurfaceType.Smooth
5761Part145.TopSurface = Enum.SurfaceType.Smooth
5762Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
5763Part145.Position = Vector3.new(14.1933136, 2.22689891, 0.599873006)
5764Part145.Orientation = Vector3.new(44.9899979, -90.0099945, -0.00999999978)
5765Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
5766BlockMesh146.Parent = Part145
5767BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
5768BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
5769Part147.Parent = Tool81
5770Part147.Material = Enum.Material.Metal
5771Part147.BrickColor = BrickColor.new("Black")
5772Part147.FormFactor = Enum.FormFactor.Custom
5773Part147.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5774Part147.CFrame = CFrame.new(13.8372335, 2.10008693, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5775Part147.BottomSurface = Enum.SurfaceType.Smooth
5776Part147.TopSurface = Enum.SurfaceType.Smooth
5777Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
5778Part147.Position = Vector3.new(13.8372335, 2.10008693, 0.599873006)
5779Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
5780BlockMesh148.Parent = Part147
5781BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
5782BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
5783Part149.Parent = Tool81
5784Part149.Material = Enum.Material.Metal
5785Part149.BrickColor = BrickColor.new("Black")
5786Part149.Rotation = Vector3.new(0, -18.9300003, 0)
5787Part149.FormFactor = Enum.FormFactor.Custom
5788Part149.Size = Vector3.new(0.965000272, 0.200000003, 0.200000003)
5789Part149.CFrame = CFrame.new(12.6539459, 2.10004497, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
5790Part149.BottomSurface = Enum.SurfaceType.Smooth
5791Part149.TopSurface = Enum.SurfaceType.Smooth
5792Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
5793Part149.Position = Vector3.new(12.6539459, 2.10004497, 0.364033014)
5794Part149.Orientation = Vector3.new(0, -18.9300003, 0)
5795Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
5796BlockMesh150.Parent = Part149
5797BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
5798BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
5799Part151.Name = "GlassPart"
5800Part151.Parent = Tool81
5801Part151.Material = Enum.Material.Glass
5802Part151.BrickColor = BrickColor.new("Institutional white")
5803Part151.Transparency = 0.5
5804Part151.Rotation = Vector3.new(0, -9.46000004, 0)
5805Part151.FormFactor = Enum.FormFactor.Custom
5806Part151.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
5807Part151.CFrame = CFrame.new(13.6316643, 3.24810004, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5808Part151.BottomSurface = Enum.SurfaceType.Smooth
5809Part151.TopSurface = Enum.SurfaceType.Smooth
5810Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
5811Part151.Position = Vector3.new(13.6316643, 3.24810004, 0.559585989)
5812Part151.Orientation = Vector3.new(0, -9.46000004, 0)
5813Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
5814BlockMesh152.Parent = Part151
5815BlockMesh152.Offset = Vector3.new(0, 0, 0.0494999997)
5816BlockMesh152.Scale = Vector3.new(1, 1, 0)
5817BlockMesh152.Scale = Vector3.new(1, 1, 0)
5818Part153.Name = "GlassPart"
5819Part153.Parent = Tool81
5820Part153.Material = Enum.Material.Glass
5821Part153.BrickColor = BrickColor.new("Institutional white")
5822Part153.Transparency = 0.5
5823Part153.Rotation = Vector3.new(0, -37.8499985, 0)
5824Part153.FormFactor = Enum.FormFactor.Custom
5825Part153.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5826Part153.CFrame = CFrame.new(11.4698019, 2.26519895, -0.257304996, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5827Part153.BottomSurface = Enum.SurfaceType.Smooth
5828Part153.TopSurface = Enum.SurfaceType.Smooth
5829Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
5830Part153.Position = Vector3.new(11.4698019, 2.26519895, -0.257304996)
5831Part153.Orientation = Vector3.new(0, -37.8499985, 0)
5832Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
5833BlockMesh154.Parent = Part153
5834BlockMesh154.Offset = Vector3.new(0, 0, 0.0494999997)
5835BlockMesh154.Scale = Vector3.new(1, 1, 0)
5836BlockMesh154.Scale = Vector3.new(1, 1, 0)
5837Part155.Parent = Tool81
5838Part155.Material = Enum.Material.Metal
5839Part155.BrickColor = BrickColor.new("Black")
5840Part155.Rotation = Vector3.new(0, -37.8499985, 0)
5841Part155.FormFactor = Enum.FormFactor.Custom
5842Part155.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5843Part155.CFrame = CFrame.new(11.5747223, 2.10004497, -0.175761998, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5844Part155.BottomSurface = Enum.SurfaceType.Smooth
5845Part155.TopSurface = Enum.SurfaceType.Smooth
5846Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
5847Part155.Position = Vector3.new(11.5747223, 2.10004497, -0.175761998)
5848Part155.Orientation = Vector3.new(0, -37.8499985, 0)
5849Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
5850BlockMesh156.Parent = Part155
5851BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
5852BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
5853Part157.Name = "GlassPart"
5854Part157.Parent = Tool81
5855Part157.Material = Enum.Material.Glass
5856Part157.BrickColor = BrickColor.new("Institutional white")
5857Part157.Transparency = 0.5
5858Part157.Rotation = Vector3.new(0, -18.9200001, 0)
5859Part157.FormFactor = Enum.FormFactor.Custom
5860Part157.Size = Vector3.new(1.5, 2.20000005, 0.200000003)
5861Part157.CFrame = CFrame.new(12.6836081, 3.24583912, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5862Part157.BottomSurface = Enum.SurfaceType.Smooth
5863Part157.TopSurface = Enum.SurfaceType.Smooth
5864Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
5865Part157.Position = Vector3.new(12.6836081, 3.24583912, 0.277363002)
5866Part157.Orientation = Vector3.new(0, -18.9200001, 0)
5867Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
5868BlockMesh158.Parent = Part157
5869BlockMesh158.Offset = Vector3.new(0, 0, 0.0494999997)
5870BlockMesh158.Scale = Vector3.new(1, 1, 0)
5871BlockMesh158.Scale = Vector3.new(1, 1, 0)
5872Part159.Name = "GlassPart"
5873Part159.Parent = Tool81
5874Part159.Material = Enum.Material.Glass
5875Part159.BrickColor = BrickColor.new("Institutional white")
5876Part159.Transparency = 0.5
5877Part159.Rotation = Vector3.new(0, 52.1499977, 180)
5878Part159.FormFactor = Enum.FormFactor.Custom
5879Part159.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5880Part159.CFrame = CFrame.new(11.2812042, 2.27716804, -0.340557009, -0.613584697, -1.39968042e-05, 0.789628863, 4.08246196e-05, -1, 1.39971562e-05, 0.789628863, 4.08247397e-05, 0.613584757)
5881Part159.BottomSurface = Enum.SurfaceType.Smooth
5882Part159.TopSurface = Enum.SurfaceType.Smooth
5883Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
5884Part159.Position = Vector3.new(11.2812042, 2.27716804, -0.340557009)
5885Part159.Orientation = Vector3.new(0, 52.1499977, 180)
5886Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
5887SpecialMesh160.Parent = Part159
5888SpecialMesh160.Scale = Vector3.new(0, 1, 1)
5889SpecialMesh160.MeshType = Enum.MeshType.Wedge
5890SpecialMesh160.Scale = Vector3.new(0, 1, 1)
5891Part161.Parent = Tool81
5892Part161.Material = Enum.Material.Metal
5893Part161.BrickColor = BrickColor.new("Black")
5894Part161.Rotation = Vector3.new(0, -9.46000004, 0)
5895Part161.FormFactor = Enum.FormFactor.Custom
5896Part161.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5897Part161.CFrame = CFrame.new(13.3488922, 2.10008693, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5898Part161.BottomSurface = Enum.SurfaceType.Smooth
5899Part161.TopSurface = Enum.SurfaceType.Smooth
5900Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
5901Part161.Position = Vector3.new(13.3488922, 2.10008693, 0.559585989)
5902Part161.Orientation = Vector3.new(0, -9.46000004, 0)
5903Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
5904BlockMesh162.Parent = Part161
5905BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
5906BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
5907Part163.Parent = Tool81
5908Part163.Material = Enum.Material.Metal
5909Part163.BrickColor = BrickColor.new("Black")
5910Part163.Rotation = Vector3.new(-121.529999, -33.9399986, -137.699997)
5911Part163.FormFactor = Enum.FormFactor.Custom
5912Part163.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
5913Part163.CFrame = CFrame.new(11.2935324, 2.22686911, -0.394268006, -0.613650262, 0.558344007, -0.558287859, -3.65348205e-05, 0.707051158, 0.70716244, 0.789577901, 0.433970869, -0.433861732)
5914Part163.BottomSurface = Enum.SurfaceType.Smooth
5915Part163.TopSurface = Enum.SurfaceType.Smooth
5916Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
5917Part163.Position = Vector3.new(11.2935324, 2.22686911, -0.394268006)
5918Part163.Orientation = Vector3.new(-45, -127.849998, 0)
5919Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
5920BlockMesh164.Parent = Part163
5921BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
5922BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
5923Part165.Name = "GlassPart"
5924Part165.Parent = Tool81
5925Part165.Material = Enum.Material.Glass
5926Part165.BrickColor = BrickColor.new("Institutional white")
5927Part165.Transparency = 0.5
5928Part165.FormFactor = Enum.FormFactor.Custom
5929Part165.Size = Vector3.new(0.400000006, 2, 0.200000003)
5930Part165.CFrame = CFrame.new(14.0699615, 3.37708712, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5931Part165.BottomSurface = Enum.SurfaceType.Smooth
5932Part165.TopSurface = Enum.SurfaceType.Smooth
5933Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
5934Part165.Position = Vector3.new(14.0699615, 3.37708712, 0.599873006)
5935Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
5936BlockMesh166.Parent = Part165
5937BlockMesh166.Offset = Vector3.new(0, 0, 0.0494999997)
5938BlockMesh166.Scale = Vector3.new(1, 1, 0)
5939BlockMesh166.Scale = Vector3.new(1, 1, 0)
5940Part167.Parent = Tool81
5941Part167.Material = Enum.Material.Metal
5942Part167.BrickColor = BrickColor.new("Black")
5943Part167.FormFactor = Enum.FormFactor.Custom
5944Part167.Size = Vector3.new(0.200000003, 2, 0.200000003)
5945Part167.CFrame = CFrame.new(14.3200836, 3.3331151, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5946Part167.BottomSurface = Enum.SurfaceType.Smooth
5947Part167.TopSurface = Enum.SurfaceType.Smooth
5948Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
5949Part167.Position = Vector3.new(14.3200836, 3.3331151, 0.599873006)
5950Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
5951BlockMesh168.Parent = Part167
5952BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
5953BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
5954Part169.Parent = Tool81
5955Part169.Material = Enum.Material.Metal
5956Part169.BrickColor = BrickColor.new("Black")
5957Part169.Rotation = Vector3.new(0, -28.3899994, 0)
5958Part169.FormFactor = Enum.FormFactor.Custom
5959Part169.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5960Part169.CFrame = CFrame.new(11.9851217, 2.10004497, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5961Part169.BottomSurface = Enum.SurfaceType.Smooth
5962Part169.TopSurface = Enum.SurfaceType.Smooth
5963Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
5964Part169.Position = Vector3.new(11.9851217, 2.10004497, 0.0920599997)
5965Part169.Orientation = Vector3.new(0, -28.3899994, 0)
5966Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
5967BlockMesh170.Parent = Part169
5968BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
5969BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
5970Part171.Name = "Handle"
5971Part171.Parent = Tool81
5972Part171.Material = Enum.Material.Metal
5973Part171.BrickColor = BrickColor.new("Black")
5974Part171.Transparency = 1
5975Part171.Rotation = Vector3.new(-179.979996, -71.0699997, -179.98999)
5976Part171.FormFactor = Enum.FormFactor.Custom
5977Part171.Size = Vector3.new(0.25, 0.25, 1.10000002)
5978Part171.CFrame = CFrame.new(12.7889557, 4.75803518, -0.0302540008, -0.324365765, 7.80466871e-05, -0.945931733, -2.83790778e-05, 1, 9.22390973e-05, 0.945931733, 5.67638745e-05, -0.324365765)
5979Part171.BottomSurface = Enum.SurfaceType.Smooth
5980Part171.TopSurface = Enum.SurfaceType.Smooth
5981Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
5982Part171.Position = Vector3.new(12.7889557, 4.75803518, -0.0302540008)
5983Part171.Orientation = Vector3.new(-0.00999999978, -108.93, 0)
5984Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
5985BlockMesh172.Parent = Part171
5986Sound173.Name = "Reload"
5987Sound173.Parent = Part171
5988Sound173.Pitch = 1.2999999523163
5989Sound173.SoundId = "http://www.roblox.com/asset/?version=1&id=2691591"
5990Sound173.Volume = 0.60000002384186
5991Sound174.Name = "Trigger"
5992Sound174.Parent = Part171
5993Sound174.Pitch = 2
5994Sound174.SoundId = "rbxasset://sounds//switch.wav"
5995Sound174.Volume = 1
5996Sound175.Name = "Fire"
5997Sound175.Parent = Part171
5998Sound175.Pitch = 3
5999Sound175.SoundId = "http://www.roblox.com/asset/?id=10730819"
6000Sound175.Volume = 1
6001Sound175.PlayOnRemove = true
6002for i,v in pairs(mas:GetChildren()) do
6003 v.Parent = game:GetService("Players").LocalPlayer.Backpack
6004 pcall(function() v:MakeJoints() end)
6005end
6006mas:Destroy()
6007for i,v in pairs(cors) do
6008 spawn(function()
6009 pcall(v)
6010 end)
6011end
6012
6013--Converted with ttyyuu12345's model to script plugin v4
6014function sandbox(var,func)
6015 local env = getfenv(func)
6016 local newenv = setmetatable({},{
6017 __index = function(self,k)
6018 if k=="script" then
6019 return var
6020 else
6021 return env[k]
6022 end
6023 end,
6024 })
6025 setfenv(func,newenv)
6026 return func
6027end
6028cors = {}
6029mas = Instance.new("Model",game:GetService("Lighting"))
6030Tool0 = Instance.new("Tool")
6031IntValue1 = Instance.new("IntValue")
6032Animation2 = Instance.new("Animation")
6033Part3 = Instance.new("Part")
6034Sound4 = Instance.new("Sound")
6035Sound5 = Instance.new("Sound")
6036Sound6 = Instance.new("Sound")
6037SpecialMesh7 = Instance.new("SpecialMesh")
6038Part8 = Instance.new("Part")
6039CylinderMesh9 = Instance.new("CylinderMesh")
6040PointLight10 = Instance.new("PointLight")
6041BillboardGui11 = Instance.new("BillboardGui")
6042ImageLabel12 = Instance.new("ImageLabel")
6043Part13 = Instance.new("Part")
6044SpecialMesh14 = Instance.new("SpecialMesh")
6045PointLight15 = Instance.new("PointLight")
6046BillboardGui16 = Instance.new("BillboardGui")
6047ImageLabel17 = Instance.new("ImageLabel")
6048Part18 = Instance.new("Part")
6049SpecialMesh19 = Instance.new("SpecialMesh")
6050PointLight20 = Instance.new("PointLight")
6051BillboardGui21 = Instance.new("BillboardGui")
6052ImageLabel22 = Instance.new("ImageLabel")
6053Part23 = Instance.new("Part")
6054SpecialMesh24 = Instance.new("SpecialMesh")
6055BillboardGui25 = Instance.new("BillboardGui")
6056ImageLabel26 = Instance.new("ImageLabel")
6057SurfaceLight27 = Instance.new("SurfaceLight")
6058Script28 = Instance.new("Script")
6059Script29 = Instance.new("Script")
6060LocalScript30 = Instance.new("LocalScript")
6061ScreenGui31 = Instance.new("ScreenGui")
6062TextLabel32 = Instance.new("TextLabel")
6063TextLabel33 = Instance.new("TextLabel")
6064Tool0.Name = "Bike"
6065Tool0.Parent = mas
6066Tool0.GripForward = Vector3.new(-0, 3.9340253e-07, -1)
6067Tool0.GripPos = Vector3.new(1.5, 1.10000002, -0.800000012)
6068Tool0.GripUp = Vector3.new(0, 1, 3.9340253e-07)
6069Tool0.CanBeDropped = false
6070IntValue1.Name = "IsReady"
6071IntValue1.Parent = Tool0
6072Animation2.Name = "holdAni"
6073Animation2.Parent = Tool0
6074Animation2.AnimationId = "http://www.roblox.com/Asset?ID=104506550"
6075Part3.Name = "Handle"
6076Part3.Parent = Tool0
6077Part3.Material = Enum.Material.Fabric
6078Part3.Elasticity = 0
6079Part3.FormFactor = Enum.FormFactor.Custom
6080Part3.Friction = 0
6081Part3.Size = Vector3.new(0.200000003, 5, 7.91000128)
6082Part3.CFrame = CFrame.new(82.3563538, 4.50000477, 70.8921051, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6083Part3.BottomSurface = Enum.SurfaceType.Smooth
6084Part3.TopSurface = Enum.SurfaceType.Smooth
6085Part3.Position = Vector3.new(82.3563538, 4.50000477, 70.8921051)
6086Sound4.Name = "Running"
6087Sound4.Parent = Part3
6088Sound4.SoundId = "rbxassetid://288319082"
6089Sound4.Volume = 0.30000001192093
6090Sound4.Looped = true
6091Sound5.Name = "Siren"
6092Sound5.Parent = Part3
6093Sound5.SoundId = "rbxassetid://295410986"
6094Sound5.Volume = 10
6095Sound5.Looped = true
6096Sound6.Name = "Siren1"
6097Sound6.Parent = Part3
6098Sound6.SoundId = "rbxassetid://295410932"
6099Sound6.Volume = 10
6100Sound6.Looped = true
6101SpecialMesh7.Parent = Part3
6102SpecialMesh7.MeshId = "rbxassetid://575950615"
6103SpecialMesh7.Offset = Vector3.new(0, 0, 0.300000012)
6104SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
6105SpecialMesh7.TextureId = "rbxassetid://72012761"
6106SpecialMesh7.MeshType = Enum.MeshType.FileMesh
6107SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
6108Part8.Name = "BackLight"
6109Part8.Parent = Tool0
6110Part8.Material = Enum.Material.SmoothPlastic
6111Part8.BrickColor = BrickColor.new("Deep blue")
6112Part8.Reflectance = 0.10000000149012
6113Part8.Transparency = 1
6114Part8.Rotation = Vector3.new(0, -90, 0)
6115Part8.CanCollide = false
6116Part8.FormFactor = Enum.FormFactor.Custom
6117Part8.Size = Vector3.new(0.400000006, 0.200000003, 0.300000012)
6118Part8.CFrame = CFrame.new(83.0562744, 6.18976879, 74.8003235, 0, 0, -1, 0, 1, 0, 1, 0, 0)
6119Part8.BottomSurface = Enum.SurfaceType.Smooth
6120Part8.TopSurface = Enum.SurfaceType.Smooth
6121Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
6122Part8.Position = Vector3.new(83.0562744, 6.18976879, 74.8003235)
6123Part8.Orientation = Vector3.new(0, -90, 0)
6124Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
6125CylinderMesh9.Parent = Part8
6126CylinderMesh9.Offset = Vector3.new(0, -0.0500000007, 0)
6127CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
6128CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
6129PointLight10.Name = "Light2"
6130PointLight10.Parent = Part8
6131PointLight10.Color = Color3.new(0, 0.666667, 1)
6132PointLight10.Enabled = false
6133PointLight10.Brightness = 5
6134PointLight10.Color = Color3.new(0, 0.666667, 1)
6135BillboardGui11.Name = "Light"
6136BillboardGui11.Parent = Part8
6137BillboardGui11.Size = UDim2.new(3, 0, 3, 0)
6138BillboardGui11.Enabled = false
6139BillboardGui11.ExtentsOffset = Vector3.new(0, 0, 1)
6140ImageLabel12.Name = "Light"
6141ImageLabel12.Parent = BillboardGui11
6142ImageLabel12.Transparency = 1
6143ImageLabel12.Size = UDim2.new(1, 0, 1, 0)
6144ImageLabel12.BackgroundTransparency = 1
6145ImageLabel12.Image = "http://www.roblox.com/asset/?id=134532208"
6146Part13.Name = "LeftLight"
6147Part13.Parent = Tool0
6148Part13.Material = Enum.Material.SmoothPlastic
6149Part13.BrickColor = BrickColor.new("Deep blue")
6150Part13.Reflectance = 0.10000000149012
6151Part13.Transparency = 1
6152Part13.Rotation = Vector3.new(0, 0, -180)
6153Part13.CanCollide = false
6154Part13.FormFactor = Enum.FormFactor.Custom
6155Part13.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
6156Part13.CFrame = CFrame.new(80.9499664, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6157Part13.BottomSurface = Enum.SurfaceType.Smooth
6158Part13.TopSurface = Enum.SurfaceType.Smooth
6159Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
6160Part13.Position = Vector3.new(80.9499664, 5.62722111, 68.2604904)
6161Part13.Orientation = Vector3.new(0, 0, -180)
6162Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
6163SpecialMesh14.Parent = Part13
6164SpecialMesh14.MeshType = Enum.MeshType.Sphere
6165PointLight15.Name = "Light2"
6166PointLight15.Parent = Part13
6167PointLight15.Color = Color3.new(0, 0.666667, 1)
6168PointLight15.Enabled = false
6169PointLight15.Brightness = 5
6170PointLight15.Color = Color3.new(0, 0.666667, 1)
6171BillboardGui16.Name = "Light"
6172BillboardGui16.Parent = Part13
6173BillboardGui16.Size = UDim2.new(3, 0, 3, 0)
6174BillboardGui16.Enabled = false
6175BillboardGui16.ExtentsOffset = Vector3.new(0, 0, 1)
6176ImageLabel17.Name = "Light"
6177ImageLabel17.Parent = BillboardGui16
6178ImageLabel17.Transparency = 1
6179ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
6180ImageLabel17.BackgroundTransparency = 1
6181ImageLabel17.Image = "http://www.roblox.com/asset/?id=134532208"
6182Part18.Name = "RightLight"
6183Part18.Parent = Tool0
6184Part18.Material = Enum.Material.SmoothPlastic
6185Part18.BrickColor = BrickColor.new("Deep blue")
6186Part18.Reflectance = 0.10000000149012
6187Part18.Transparency = 1
6188Part18.Rotation = Vector3.new(0, 0, -180)
6189Part18.CanCollide = false
6190Part18.FormFactor = Enum.FormFactor.Custom
6191Part18.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
6192Part18.CFrame = CFrame.new(83.6999817, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6193Part18.BottomSurface = Enum.SurfaceType.Smooth
6194Part18.TopSurface = Enum.SurfaceType.Smooth
6195Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
6196Part18.Position = Vector3.new(83.6999817, 5.62722111, 68.2604904)
6197Part18.Orientation = Vector3.new(0, 0, -180)
6198Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
6199SpecialMesh19.Parent = Part18
6200SpecialMesh19.MeshType = Enum.MeshType.Sphere
6201PointLight20.Name = "Light2"
6202PointLight20.Parent = Part18
6203PointLight20.Color = Color3.new(0, 0.666667, 1)
6204PointLight20.Enabled = false
6205PointLight20.Brightness = 5
6206PointLight20.Color = Color3.new(0, 0.666667, 1)
6207BillboardGui21.Name = "Light"
6208BillboardGui21.Parent = Part18
6209BillboardGui21.Size = UDim2.new(3, 0, 3, 0)
6210BillboardGui21.Enabled = false
6211BillboardGui21.ExtentsOffset = Vector3.new(0, 0, 1)
6212ImageLabel22.Name = "Light"
6213ImageLabel22.Parent = BillboardGui21
6214ImageLabel22.Transparency = 1
6215ImageLabel22.Size = UDim2.new(1, 0, 1, 0)
6216ImageLabel22.BackgroundTransparency = 1
6217ImageLabel22.Image = "http://www.roblox.com/asset/?id=134532208"
6218Part23.Name = "FrontLight"
6219Part23.Parent = Tool0
6220Part23.Material = Enum.Material.SmoothPlastic
6221Part23.BrickColor = BrickColor.new("Deep blue")
6222Part23.Reflectance = 0.10000000149012
6223Part23.Transparency = 1
6224Part23.Rotation = Vector3.new(0, 0, -180)
6225Part23.CanCollide = false
6226Part23.FormFactor = Enum.FormFactor.Custom
6227Part23.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
6228Part23.CFrame = CFrame.new(82.3499832, 4.52722788, 67.5604935, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6229Part23.BottomSurface = Enum.SurfaceType.Smooth
6230Part23.TopSurface = Enum.SurfaceType.Smooth
6231Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
6232Part23.Position = Vector3.new(82.3499832, 4.52722788, 67.5604935)
6233Part23.Orientation = Vector3.new(0, 0, -180)
6234Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
6235SpecialMesh24.Parent = Part23
6236SpecialMesh24.MeshType = Enum.MeshType.Sphere
6237BillboardGui25.Name = "Light"
6238BillboardGui25.Parent = Part23
6239BillboardGui25.Size = UDim2.new(5, 0, 3, 0)
6240BillboardGui25.Enabled = false
6241BillboardGui25.ExtentsOffset = Vector3.new(0, 0, 1)
6242ImageLabel26.Name = "Light"
6243ImageLabel26.Parent = BillboardGui25
6244ImageLabel26.Transparency = 1
6245ImageLabel26.Size = UDim2.new(1, 0, 1, 0)
6246ImageLabel26.BackgroundTransparency = 1
6247ImageLabel26.Image = "http://www.roblox.com/asset/?id=23596922"
6248SurfaceLight27.Name = "Light2"
6249SurfaceLight27.Parent = Part23
6250SurfaceLight27.Range = 19.239078521729
6251SurfaceLight27.Angle = 57.401973724365
6252Script28.Parent = Part23
6253table.insert(cors,sandbox(Script28,function()
6254while true do
6255 wait()
6256if script.Parent.Parent.BackLight.Light.Enabled == true then
6257 script.Parent.Light.Enabled = true
6258 script.Parent.Light2.Enabled = true
6259 else
6260 script.Parent.Light.Enabled = false
6261 script.Parent.Light2.Enabled = false
6262 end
6263end
6264end))
6265Script29.Name = "qPerfectionWeld"
6266Script29.Parent = Tool0
6267table.insert(cors,sandbox(Script29,function()
6268-- Created by Quenty (@Quenty, follow me on twitter).
6269-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
6270-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
6271
6272--[[ INSTRUCTIONS
6273- Place in the model
6274- Make sure model is anchored
6275- That's it. It will weld the model and all children.
6276
6277THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6278THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6279THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6280THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6281THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6282THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6283THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6284THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
6285
6286This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
6287]]
6288
6289--[[ DOCUMENTATION
6290- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
6291- Will work in PBS servers
6292- Will work as long as it starts out with the part anchored
6293- Stores the relative CFrame as a CFrame value
6294- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
6295- Utilizes a recursive algorith to find all parts in the model
6296- Will reweld on script reparent if the script is initially parented to a tool.
6297- Welds as fast as possible
6298]]
6299
6300-- qPerfectionWeld.lua
6301-- Created 10/6/2014
6302-- Author: Quenty
6303-- Version 1.0.3
6304
6305-- Updated 10/14/2014 - Updated to 1.0.1
6306--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
6307
6308-- Updated 10/14/2014 - Updated to 1.0.2
6309--- Fixed bug fix.
6310
6311-- Updated 10/14/2014 - Updated to 1.0.3
6312--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
6313
6314local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
6315
6316
6317local function CallOnChildren(Instance, FunctionToCall)
6318 -- Calls a function on each of the children of a certain object, using recursion.
6319
6320 FunctionToCall(Instance)
6321
6322 for _, Child in next, Instance:GetChildren() do
6323 CallOnChildren(Child, FunctionToCall)
6324 end
6325end
6326
6327local function GetNearestParent(Instance, ClassName)
6328 -- Returns the nearest parent of a certain class, or returns nil
6329
6330 local Ancestor = Instance
6331 repeat
6332 Ancestor = Ancestor.Parent
6333 if Ancestor == nil then
6334 return nil
6335 end
6336 until Ancestor:IsA(ClassName)
6337
6338 return Ancestor
6339end
6340
6341local function GetBricks(StartInstance)
6342 local List = {}
6343
6344 -- if StartInstance:IsA("BasePart") then
6345 -- List[#List+1] = StartInstance
6346 -- end
6347
6348 CallOnChildren(StartInstance, function(Item)
6349 if Item:IsA("BasePart") then
6350 List[#List+1] = Item;
6351 end
6352 end)
6353
6354 return List
6355end
6356
6357local function Modify(Instance, Values)
6358 -- Modifies an Instance by using a table.
6359
6360 assert(type(Values) == "table", "Values is not a table");
6361
6362 for Index, Value in next, Values do
6363 if type(Index) == "number" then
6364 Value.Parent = Instance
6365 else
6366 Instance[Index] = Value
6367 end
6368 end
6369 return Instance
6370end
6371
6372local function Make(ClassType, Properties)
6373 -- Using a syntax hack to create a nice way to Make new items.
6374
6375 return Modify(Instance.new(ClassType), Properties)
6376end
6377
6378local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
6379local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
6380
6381local function HasWheelJoint(Part)
6382 for _, SurfaceName in pairs(Surfaces) do
6383 for _, HingSurfaceName in pairs(HingSurfaces) do
6384 if Part[SurfaceName].Name == HingSurfaceName then
6385 return true
6386 end
6387 end
6388 end
6389
6390 return false
6391end
6392
6393local function ShouldBreakJoints(Part)
6394 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
6395 -- definitely some edge cases.
6396
6397 if NEVER_BREAK_JOINTS then
6398 return false
6399 end
6400
6401 if HasWheelJoint(Part) then
6402 return false
6403 end
6404
6405 local Connected = Part:GetConnectedParts()
6406
6407 if #Connected == 1 then
6408 return false
6409 end
6410
6411 for _, Item in pairs(Connected) do
6412 if HasWheelJoint(Item) then
6413 return false
6414 elseif not Item:IsDescendantOf(script.Parent) then
6415 return false
6416 end
6417 end
6418
6419 return true
6420end
6421
6422local function WeldTogether(Part0, Part1, JointType, WeldParent)
6423 --- Weld's 2 parts together
6424 -- @param Part0 The first part
6425 -- @param Part1 The second part (Dependent part most of the time).
6426 -- @param [JointType] The type of joint. Defaults to weld.
6427 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
6428 -- @return The weld created.
6429
6430 JointType = JointType or "Weld"
6431 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
6432
6433 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
6434 Modify(NewWeld, {
6435 Name = "qCFrameWeldThingy";
6436 Part0 = Part0;
6437 Part1 = Part1;
6438 C0 = CFrame.new();--Part0.CFrame:inverse();
6439 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
6440 Parent = Part1;
6441 })
6442
6443 if not RelativeValue then
6444 RelativeValue = Make("CFrameValue", {
6445 Parent = Part1;
6446 Name = "qRelativeCFrameWeldValue";
6447 Archivable = true;
6448 Value = NewWeld.C1;
6449 })
6450 end
6451
6452 return NewWeld
6453end
6454
6455local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
6456 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
6457 -- @param MainPart The part to weld the model to (can be in the model).
6458 -- @param [JointType] The type of joint. Defaults to weld.
6459 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
6460
6461 for _, Part in pairs(Parts) do
6462 if ShouldBreakJoints(Part) then
6463 Part:BreakJoints()
6464 end
6465 end
6466
6467 for _, Part in pairs(Parts) do
6468 if Part ~= MainPart then
6469 WeldTogether(MainPart, Part, JointType, MainPart)
6470 end
6471 end
6472
6473 if not DoNotUnanchor then
6474 for _, Part in pairs(Parts) do
6475 Part.Anchored = false
6476 end
6477 MainPart.Anchored = false
6478 end
6479end
6480
6481local function PerfectionWeld()
6482 local Tool = GetNearestParent(script, "Tool")
6483
6484 local Parts = GetBricks(script.Parent)
6485 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
6486
6487 if PrimaryPart then
6488 WeldParts(Parts, PrimaryPart, "Weld", false)
6489 else
6490 warn("qWeld - Unable to weld part")
6491 end
6492
6493 return Tool
6494end
6495
6496local Tool = PerfectionWeld()
6497
6498
6499if Tool and script.ClassName == "Script" then
6500 --- Don't bother with local scripts
6501
6502 script.Parent.AncestryChanged:connect(function()
6503 PerfectionWeld()
6504 end)
6505end
6506
6507-- Created by Quenty (@Quenty, follow me on twitter).
6508
6509end))
6510LocalScript30.Name = "continuumScript"
6511LocalScript30.Parent = Tool0
6512table.insert(cors,sandbox(LocalScript30,function()
6513function WaitForChild(parent,child)
6514 return parent[child]
6515end
6516
6517local int = WaitForChild(script.Parent,'IsReady')
6518local handle = WaitForChild(script.Parent,'Handle')
6519local BackLight = WaitForChild(script.Parent,'BackLight')
6520local LeftLight = WaitForChild(script.Parent,'LeftLight')
6521local RightLight = WaitForChild(script.Parent,'RightLight')
6522local EngineSound = WaitForChild(handle,'Running')
6523local gui2 = nil
6524local radio = false
6525local siren = false
6526local siren2 = false
6527
6528local HoldAni = WaitForChild(script.Parent,'holdAni')
6529
6530local lights = false
6531local left=false
6532local right=false
6533local up=false
6534local down=false
6535local mouse
6536local Character
6537local key_down_connect
6538local key_up_connect
6539
6540local thrustForce
6541local thrustMagnitude
6542local thrustDirection
6543local RotationForce
6544local TurnGyro
6545
6546local HoldAniTrack
6547
6548local torsoWeld
6549
6550local SmokePart = Instance.new('Part')
6551SmokePart.Transparency = 1
6552SmokePart.Size = Vector3.new(0,0,0)
6553local ExhaustSmoke = Instance.new('Smoke')
6554ExhaustSmoke.Parent = SmokePart
6555ExhaustSmoke.Size = .1
6556ExhaustSmoke.RiseVelocity = .01
6557ExhaustSmoke.Color = Color3.new(.5,.5,.5)
6558ExhaustSmoke.Enabled = false
6559
6560local acceleration = 30
6561local deceleration = 25
6562local turnAlpha = .25
6563local alphaDampening = .15
6564
6565local Equipped = false
6566
6567local LastPosition = nil
6568local ActualVelocity = Vector3.new(0,0,0)
6569
6570local FakeHandle = nil
6571local FrontWheel = Instance.new('Part')
6572FrontWheel.FormFactor = 'Custom'
6573FrontWheel.CanCollide = false
6574FrontWheel.Size = Vector3.new(0,0,0)
6575
6576local WheelMesh = Instance.new('SpecialMesh')
6577WheelMesh.MeshId = "http://www.roblox.com/asset/?id=438123816"
6578WheelMesh.TextureId = "http://www.roblox.com/asset/?id=438106307"
6579WheelMesh.Scale = Vector3.new(0.007,0.007,0.007)
6580
6581local Light = FrontWheel:Clone()
6582local LightWeld = nil
6583
6584local FrontMotor = nil
6585local BackWheel = FrontWheel:Clone()
6586local BackMotor = nil
6587
6588local CurrentSpeed=0
6589local turnSpeed=0
6590local turnSpeedAim=10
6591
6592function ThrustUpdater()
6593coroutine.resume(coroutine.create(function()
6594 while Equipped do wait()
6595 if lights then
6596 BackLight.Light.Enabled = true
6597 LeftLight.Light.Enabled = true
6598 BackLight.Light2.Enabled = true
6599 LeftLight.Light2.Enabled = true
6600 wait(0.1)
6601 RightLight.Light.Enabled = true
6602 LeftLight.Light.Enabled = false
6603 RightLight.Light2.Enabled = true
6604 LeftLight.Light2.Enabled = false
6605 wait(0.1)
6606 RightLight.Light.Enabled = false
6607 BackLight.Light.Enabled = false
6608 RightLight.Light2.Enabled = false
6609 BackLight.Light2.Enabled = false
6610 wait(0.1)
6611 BackLight.Light.Enabled = false
6612 LeftLight.Light.Enabled = false
6613 RightLight.Light.Enabled = false
6614 BackLight.Light2.Enabled = false
6615 LeftLight.Light2.Enabled = false
6616 RightLight.Light2.Enabled = false wait(0.1)
6617 end
6618 end
6619lights = false
6620BackLight.Material = "SmoothPlastic"
6621LeftLight.Material = "SmoothPlastic"
6622RightLight.Material = "SmoothPlastic"
6623BackLight.Light2.Enabled = false
6624LeftLight.Light2.Enabled = false
6625RightLight.Light2.Enabled = false
6626end))
6627if not script:findFirstChild("Selected") then
6628Instance.new("IntValue",script).Name = "Selected"
6629game.Players[script.Parent.Parent.Name].Chatted:connect(function(MSG)
6630 if radio and game.Lighting:findFirstChild("OfficerRadioSystem") and game.Players[script.Parent.Parent.Name]:findFirstChild("PlayerGui") then
6631 if game.Players[script.Parent.Parent.Name].PlayerGui:findFirstChild("OfficerRadio") and Equipped then
6632 local Channel = game.Lighting["OfficerRadioSystem"]
6633 Channel.Line1.Value = Channel.Line2.Value
6634 Channel.Line2.Value = Channel.Line3.Value
6635 Channel.Line3.Value = Channel.Line4.Value
6636 Channel.Line4.Value = Channel.Line5.Value
6637 Channel.Line5.Value = Channel.Line6.Value
6638 Channel.Line6.Value = Channel.Line7.Value
6639 Channel.Line7.Value = script.Parent.Parent.Name..": "..MSG
6640 end
6641 end
6642end)
6643end
6644 while Equipped do
6645 local direction = Character:FindFirstChild("Torso").CFrame.lookVector
6646 direction = Vector3.new(direction.x,0,direction.z).unit
6647 thrustForce.velocity = direction*(CurrentSpeed)
6648 EngineSound.Pitch = 1+(math.abs(CurrentSpeed/50)*1)
6649
6650 if FrontMotor then
6651 FrontMotor.DesiredAngle=(999999999)* (-CurrentSpeed/math.abs(CurrentSpeed))
6652 FrontMotor.MaxVelocity = CurrentSpeed/250
6653 if BackMotor then
6654 BackMotor.DesiredAngle = FrontMotor.DesiredAngle
6655 BackMotor.MaxVelocity = FrontMotor.MaxVelocity
6656 end
6657 end
6658
6659 RotationForce.angularvelocity = Vector3.new(0, turnSpeed, 0)
6660 if math.abs(turnSpeed)>alphaDampening then
6661 turnSpeed= turnSpeed-((alphaDampening)*(math.abs(turnSpeed)/turnSpeed))
6662 else
6663 turnSpeed = 0
6664 end
6665 local leanAmount= -turnSpeed*(math.pi/6)/10 --FIND ME
6666
6667 if not forwards or back then
6668 CurrentSpeed = CurrentSpeed*.99
6669 end
6670
6671 local xzAngle = math.atan2(Character.Torso.CFrame.lookVector.z,0, Character.Torso.CFrame.lookVector.x)
6672 TurnGyro.cframe=CFrame.Angles(leanAmount*direction.x,0,leanAmount*direction.z)
6673 ExhaustSmoke.Opacity = (math.min(math.abs(CurrentSpeed),10)/10)*.5
6674 if LastPosition then
6675 local npos = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
6676 --(npos-LastPosition).magnitude
6677 local myspeed =Vector3.new(FakeHandle.Velocity.X,0,FakeHandle.Velocity.Z).magnitude
6678 local velocityDifference = math.abs((myspeed - (thrustForce.velocity.magnitude)))
6679 if myspeed>3 and thrustForce.velocity.magnitude>3 and velocityDifference> .7*thrustForce.velocity.magnitude then
6680 CurrentSpeed=CurrentSpeed*.9
6681 end
6682
6683 end
6684 LastPosition = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
6685 wait(1/60)
6686 end
6687
6688end
6689
6690
6691function onEquipped(nmouse)
6692 Spawn(function()
6693 if Equipped then
6694 return
6695 end
6696 --
6697 local gui = WaitForChild(game.Players[script.Parent.Parent.Name],"PlayerGui")
6698 gui2 = script.BikeGui:Clone()
6699 gui2.Parent = gui
6700 Character=script.Parent.Parent
6701 local myTorso = WaitForChild(Character,'Torso')
6702 if not FakeHandle then
6703 FakeHandle = handle:Clone()
6704 FakeHandle.Name = 'FakeHandle'
6705 FakeHandle.Size = Vector3.new(1, 7, 6)
6706 FakeHandle:WaitForChild('Mesh').MeshId = "http://www.roblox.com/asset/?id=575950615"
6707
6708 end
6709 FakeHandle.Parent = script.Parent
6710 FakeHandle.CFrame = myTorso.CFrame
6711 handle.Transparency = 1
6712
6713 Spawn(function()
6714
6715 FrontWheel.Parent = FakeHandle
6716 FrontMotor = Instance.new('Motor6D')
6717 FrontMotor.C0 = CFrame.new(0, -2.4, -3.02) * CFrame.Angles(0, (math.pi / 2), 0)
6718 FrontMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
6719 FrontMotor.Part0 = FakeHandle
6720 FrontMotor.Part1 = FrontWheel
6721 FrontMotor.Parent =FakeHandle
6722 WheelMesh:Clone().Parent = FrontWheel
6723
6724 BackWheel.Parent = FakeHandle
6725 BackMotor = Instance.new('Motor6D')
6726 BackMotor.C0 = CFrame.new(0, -2.4, 2.9) * CFrame.Angles(0, (math.pi / 2), 0)
6727 BackMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
6728 BackMotor.Part0 = FakeHandle
6729 BackMotor.Part1 = BackWheel
6730 BackMotor.Parent =FakeHandle
6731 WheelMesh:Clone().Parent = BackWheel
6732
6733 Light.Parent = FakeHandle
6734 LightWeld = Instance.new('Weld')
6735 LightWeld.C0 = CFrame.new(0, 0, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
6736 LightWeld.C1 = CFrame.new(-0.140708923, -0.749996185, -0.9377985, -1.63912773e-007, -1.27675008e-008, -1.00000024, -2.05633661e-008, 0.99999994, 3.65663944e-009, 0.999999881, 5.65337004e-008, -7.4505806e-008)
6737 LightWeld.Part0 = FakeHandle
6738 LightWeld.Part1 = Light
6739 LightWeld.Parent = FakeHandle
6740 local tlight = Instance.new('SpotLight')
6741 tlight.Brightness = 1
6742 tlight.Angle=45
6743 tlight.Color = Color3.new(255/255,252/255,153/255)
6744 tlight.Parent = Light
6745 tlight.Range = 40
6746
6747 end)
6748
6749 CurrentSpeed=0
6750 turnSpeed=0
6751 mouse=nmouse
6752 Equipped = true
6753
6754 handle.CFrame = myTorso.CFrame
6755 WaitForChild(Character,'Humanoid').PlatformStand = true
6756
6757 if RotationForce then RotationForce:Destroy() end
6758 RotationForce = Instance.new('BodyAngularVelocity')
6759 RotationForce.maxTorque = Vector3.new(0, math.huge, 0)
6760 RotationForce.angularvelocity = Vector3.new(0, 0, 0)
6761 RotationForce.Parent = myTorso
6762
6763 if thrustForce then thrustForce:Destroy() end
6764 thrustForce = Instance.new('BodyVelocity')
6765 thrustForce.maxForce = Vector3.new(math.huge,0,math.huge)
6766 thrustForce.velocity = Vector3.new(0,0,0)
6767 thrustForce.P = 100
6768 thrustForce.Parent = FakeHandle--myTorso
6769
6770 if TurnGyro then TurnGyro:Destroy() end
6771 TurnGyro = Instance.new('BodyGyro')
6772 TurnGyro.maxTorque = Vector3.new(5000,0,5000)
6773 TurnGyro.P = 300
6774 TurnGyro.D=100
6775 TurnGyro.Parent = myTorso
6776
6777 Spawn(ThrustUpdater)
6778 if HoldAniTrack then HoldAniTrack:Stop() end
6779 HoldAniTrack = WaitForChild(Character,'Humanoid'):LoadAnimation(HoldAni)
6780 HoldAniTrack:Play()
6781 Spawn(function()
6782
6783
6784 myTorso.Anchored = true
6785 myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
6786
6787 if torsoWeld then torsoWeld:Destroy() end
6788 torsoWeld=Instance.new('Weld')
6789 torsoWeld.C0 = CFrame.Angles(0,0,0) + Vector3.new(0, -0.6, -0.7) --FIND ME -1.6
6790 torsoWeld.Part0 = myTorso
6791 torsoWeld.Part1 = FakeHandle
6792 torsoWeld.Parent = FakeHandle
6793 FakeHandle.CanCollide = true
6794
6795 wait(.1)
6796 FakeHandle.CanCollide = true
6797 myTorso.Anchored = false
6798 myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
6799 end)
6800
6801 if key_down_connect then
6802 key_down_connect:disconnect()
6803 key_up_connect:disconnect()
6804 end
6805 key_down_connect=mouse.KeyDown:connect(keyDownFunc)
6806 key_up_connect=mouse.KeyUp:connect(keyUpFunc)
6807
6808 SmokePart.Parent = FakeHandle
6809
6810 local tweld=Instance.new('Weld')
6811 tweld.C0 = CFrame.new(0.600000024, 1.10000014, -2.20000005, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6812 tweld.Part0 = SmokePart
6813 tweld.Part1 = FakeHandle
6814 tweld.Parent = SmokePart
6815
6816 EngineSound:Play()
6817 Character.Humanoid.WalkSpeed = 0
6818 --end
6819 end)
6820end
6821
6822
6823function onUnequipped()
6824 Equipped = false
6825 if gui2 then
6826 gui2:Remove() gui2 = nil
6827 end
6828 if SmokePart then
6829 SmokePart.Parent = nil
6830 end
6831 if FakeHandle then
6832 FakeHandle:Remove()
6833 FakeHandle = nil
6834 end
6835 handle.Transparency = 0
6836 --handle.Size = Vector3.new(0.2, 0.2, 0.2)
6837 forwards = false
6838 left = false
6839 back = false
6840 right = false
6841 if RotationForce then
6842 RotationForce:Destroy()
6843 RotationForce=nil
6844 end
6845 if thrustForce then
6846 thrustForce:Destroy()
6847 thrustForce=nil
6848 end
6849 if TurnGyro then
6850 TurnGyro:Destroy()
6851 TurnGyro=nil
6852 end
6853 if HoldAniTrack then
6854 HoldAniTrack:Stop()
6855 end
6856 if torsoWeld then
6857 torsoWeld:Destroy()
6858 torsoWeld=nil
6859 end
6860 if key_down_connect then
6861 key_down_connect:disconnect()
6862 key_down_connect=nil
6863 end
6864 if key_up_connect then
6865 key_up_connect:disconnect()
6866 key_up_connect=nil
6867 end
6868 if EngineSound then
6869 EngineSound:Stop()
6870 end
6871 if Character and Character:FindFirstChild('Humanoid') then
6872 Character.Humanoid.WalkSpeed = 16
6873 Character.Humanoid.PlatformStand = false
6874 end
6875end
6876
6877
6878
6879
6880function keyUpFunc(key)
6881 if key == nil then return end
6882 local key = key:lower()
6883 if key == "w" then
6884 forwards = false
6885 elseif key == "a" then
6886 left = false
6887 elseif key == "s" then
6888 back = false
6889 elseif key == "d" then
6890 right = false
6891 end
6892end
6893local LastSpace = tick()
6894function keyDownFunc(key)
6895 if key == nil then return end
6896 if inIntro then return end
6897 local key = key:lower()
6898 if key == "w" then
6899 forwards = true
6900 while forwards do
6901 CurrentSpeed = math.min(120,CurrentSpeed+(acceleration*(1/30)))
6902 wait(1/30)
6903 end
6904 elseif key == "a" then
6905 left = true
6906 while left do
6907 turnSpeed= math.min(5,turnSpeed+(turnAlpha))
6908 wait(1/30)
6909 end
6910 elseif key == "s" then
6911 back = true
6912 while back do
6913 if CurrentSpeed>0 then
6914 CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*2.8*(1/30)))
6915 else
6916 CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*(1/30)))
6917 end
6918 wait(1/30)
6919 end
6920 elseif key == "d" then
6921 right = true
6922
6923 while right do
6924 turnSpeed= math.max(-5,turnSpeed-(turnAlpha))
6925 wait(1/30)
6926 end
6927 elseif key == ' ' then
6928 if tick()-LastSpace>1.9 then
6929 LastSpace = tick()
6930 local bforce = Instance.new('BodyForce')
6931 bforce.force = Vector3.new(0,25000,0)
6932 bforce.Parent = FakeHandle
6933 wait(.1)
6934 bforce:Destroy()
6935 end
6936 elseif key == "r" then
6937 lights = not lights
6938 elseif key == "t" then
6939 if siren then
6940 siren = false
6941 else
6942 siren2 = false
6943 siren = true
6944 handle.Siren:Play()
6945 while siren and Equipped do
6946 wait()
6947 end
6948 handle.Siren:Stop()
6949 end
6950 elseif key == "y" then
6951 if siren2 then
6952 siren2 = false
6953 else
6954 siren = false
6955 siren2 = true
6956 handle.Siren1:Play()
6957 while siren2 and Equipped do
6958 wait()
6959 end
6960 handle.Siren1:Stop()
6961 end
6962 end
6963end
6964
6965script.Parent.Unequipped:connect(onUnequipped)
6966script.Parent.Equipped:connect(onEquipped)
6967
6968
6969end))
6970ScreenGui31.Name = "BikeGui"
6971ScreenGui31.Parent = LocalScript30
6972TextLabel32.Name = "Creds"
6973TextLabel32.Parent = ScreenGui31
6974TextLabel32.Transparency = 1
6975TextLabel32.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
6976TextLabel32.Text = "Bike by clonetrooper517"
6977TextLabel32.Position = UDim2.new(0.850000024, 0, 0.949999988, 0)
6978TextLabel32.BackgroundColor3 = Color3.new(1, 1, 1)
6979TextLabel32.BackgroundTransparency = 1
6980TextLabel32.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
6981TextLabel32.BorderSizePixel = 0
6982TextLabel32.Font = Enum.Font.ArialBold
6983TextLabel32.FontSize = Enum.FontSize.Size18
6984TextLabel32.TextColor3 = Color3.new(1, 1, 1)
6985TextLabel32.TextStrokeColor3 = Color3.new(1, 1, 1)
6986TextLabel32.TextTransparency = 0.25
6987TextLabel32.TextWrapped = true
6988TextLabel33.Name = "Creds"
6989TextLabel33.Parent = ScreenGui31
6990TextLabel33.Transparency = 1
6991TextLabel33.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
6992TextLabel33.Text = "Keys : R - Lights || T - Wail || Y - Yelp "
6993TextLabel33.Position = UDim2.new(0.850000024, 0, 0.930000007, 0)
6994TextLabel33.BackgroundColor3 = Color3.new(1, 1, 1)
6995TextLabel33.BackgroundTransparency = 1
6996TextLabel33.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
6997TextLabel33.BorderSizePixel = 0
6998TextLabel33.Font = Enum.Font.ArialBold
6999TextLabel33.FontSize = Enum.FontSize.Size18
7000TextLabel33.TextColor3 = Color3.new(1, 1, 1)
7001TextLabel33.TextStrokeColor3 = Color3.new(1, 1, 1)
7002TextLabel33.TextTransparency = 0.25
7003TextLabel33.TextWrapped = true
7004for i,v in pairs(mas:GetChildren()) do
7005 v.Parent = game:GetService("Players").LocalPlayer.Backpack
7006 pcall(function() v:MakeJoints() end)
7007end
7008mas:Destroy()
7009for i,v in pairs(cors) do
7010 spawn(function()
7011 pcall(v)
7012 end)
7013end
7014
7015--Converted with ttyyuu12345's model to script plugin v4
7016function sandbox(var,func)
7017 local env = getfenv(func)
7018 local newenv = setmetatable({},{
7019 __index = function(self,k)
7020 if k=="script" then
7021 return var
7022 else
7023 return env[k]
7024 end
7025 end,
7026 })
7027 setfenv(func,newenv)
7028 return func
7029end
7030cors = {}
7031mas = Instance.new("Model",game:GetService("Lighting"))
7032Tool0 = Instance.new("Tool")
7033Part1a = Instance.new("Part")
7034SpecialMesh2 = Instance.new("SpecialMesh")
7035Sound3 = Instance.new("Sound")
7036Sound4 = Instance.new("Sound")
7037Sound5 = Instance.new("Sound")
7038Sound6 = Instance.new("Sound")
7039Sound7 = Instance.new("Sound")
7040Fire8 = Instance.new("Fire")
7041SpotLight9 = Instance.new("SpotLight")
7042LocalScript10 = Instance.new("LocalScript")
7043LocalScript11 = Instance.new("LocalScript")
7044ScreenGui12 = Instance.new("ScreenGui")
7045Frame13 = Instance.new("Frame")
7046Frame14 = Instance.new("Frame")
7047Frame15 = Instance.new("Frame")
7048Frame16 = Instance.new("Frame")
7049Frame17 = Instance.new("Frame")
7050ImageLabel18 = Instance.new("ImageLabel")
7051TextLabel19 = Instance.new("TextLabel")
7052Frame20 = Instance.new("Frame")
7053TextLabel21 = Instance.new("TextLabel")
7054TextLabel22 = Instance.new("TextLabel")
7055TextLabel23 = Instance.new("TextLabel")
7056Animation24 = Instance.new("Animation")
7057Animation25 = Instance.new("Animation")
7058Animation26 = Instance.new("Animation")
7059Tool0.Name = "Shotgun"
7060Tool0.Parent = mas
7061Tool0.GripForward = Vector3.new(-0.502650201, 0.864488423, 0.00155316177)
7062Tool0.GripPos = Vector3.new(0.382296324, -0.310117602, -0.246956125)
7063Tool0.GripRight = Vector3.new(0.864489377, 0.502651095, -0.000195711225)
7064Tool0.GripUp = Vector3.new(0.000949888548, -0.00124431751, 0.999998748)
7065Part1a.Name = "Handle"
7066Part1a.Parent = Tool0
7067Part1a.BrickColor = BrickColor.new("Dark stone grey")
7068Part1a.Rotation = Vector3.new(-90, 0, 0)
7069Part1a.CanCollide = false
7070Part1a.FormFactor = Enum.FormFactor.Custom
7071Part1a.Size = Vector3.new(0.200000003, 2.39999986, 0.600000024)
7072Part1a.CFrame = CFrame.new(97.9000015, 2.29999995, 1.00000072, 0.999999642, -3.04374943e-08, 8.94069387e-08, 2.83367569e-08, 3.00544468e-14, 0.999999702, 8.8771742e-08, -0.999999583, 4.95648855e-08)
7073Part1a.BackSurface = Enum.SurfaceType.Weld
7074Part1a.BottomSurface = Enum.SurfaceType.Weld
7075Part1a.FrontSurface = Enum.SurfaceType.Weld
7076Part1a.LeftSurface = Enum.SurfaceType.Weld
7077Part1a.RightSurface = Enum.SurfaceType.Weld
7078Part1a.TopSurface = Enum.SurfaceType.Weld
7079Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
7080Part1a.Position = Vector3.new(97.9000015, 2.29999995, 1.00000072)
7081Part1a.Orientation = Vector3.new(-89.9599991, 61, 90)
7082Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
7083SpecialMesh2.Parent = Part1a
7084SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=71947462"
7085SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=71947415"
7086SpecialMesh2.VertexColor = Vector3.new(2, 2, 2)
7087SpecialMesh2.MeshType = Enum.MeshType.FileMesh
7088Sound3.Name = "Empty"
7089Sound3.Parent = Part1a
7090Sound3.SoundId = "rbxassetid://240785604"
7091Sound3.Volume = 1
7092Sound4.Name = "FireSound"
7093Sound4.Parent = Part1a
7094Sound4.SoundId = "rbxassetid://330706798"
7095Sound4.Volume = 1
7096Sound5.Name = "InsertSound"
7097Sound5.Parent = Part1a
7098Sound5.SoundId = "rbxassetid://255061162"
7099Sound5.Volume = 1
7100Sound6.Name = "PumpSound"
7101Sound6.Parent = Part1a
7102Sound6.SoundId = "rbxassetid://131072992"
7103Sound6.Volume = 0.75
7104Sound7.Name = "Reload"
7105Sound7.Parent = Part1a
7106Sound7.SoundId = "rbxassetid://198915489"
7107Sound7.Volume = 1
7108Fire8.Parent = Part1a
7109Fire8.Size = 2
7110Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
7111Fire8.Enabled = false
7112Fire8.Heat = 0
7113Fire8.SecondaryColor = Color3.new(0, 0, 0)
7114Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
7115SpotLight9.Name = "Light"
7116SpotLight9.Parent = Part1a
7117SpotLight9.Color = Color3.new(1, 1, 0.498039)
7118SpotLight9.Enabled = false
7119SpotLight9.Brightness = 50
7120SpotLight9.Range = 18
7121SpotLight9.Angle = 120
7122SpotLight9.Face = Enum.NormalId.Top
7123SpotLight9.Color = Color3.new(1, 1, 0.498039)
7124LocalScript10.Name = "CameraMoveDev"
7125LocalScript10.Parent = Tool0
7126table.insert(cors,sandbox(LocalScript10,function()
7127local RunService = game:GetService('RunService')
7128local player = game.Players.LocalPlayer
7129local mouse = player:GetMouse()
7130repeat wait() until player.Character
7131repeat wait() until player.Character:FindFirstChild("Humanoid")
7132repeat wait() until player.Character:FindFirstChild("Torso")
7133local character = player.Character
7134local humanoid = character:WaitForChild("Humanoid")
7135torso = character.Torso
7136keyhold = false
7137--player.CameraMinZoomDistance = 0.5
7138lighting = true
7139haslight = false
7140
7141mouse.TargetFilter = nil
7142
7143--humanoid.JumpPower = 0
7144
7145maxcount = 100
7146runcount = maxcount
7147
7148function populateparts(mdl)
7149 if mdl:IsA("BasePart") then
7150 table.insert(parts,mdl)
7151 end
7152 for i2,mdl2 in ipairs(mdl:GetChildren()) do
7153 populateparts(mdl2)
7154 end
7155end
7156
7157function weldBetween(a, b)
7158 --Make a new Weld and Parent it to a.
7159 weld = Instance.new("ManualWeld", a)
7160 --Get the CFrame of b relative to a.
7161 weld.C0 = a.CFrame:inverse() * b.CFrame
7162 --Set the Part0 and Part1 properties respectively
7163 weld.Part0 = a
7164 weld.Part1 = b
7165 --Return the reference to the weld so that you can change it later.
7166 return weld
7167end
7168
7169humanoid.Died:connect(function()
7170 if armgroup then
7171 armgroup:Destroy()
7172 if cl then
7173 cl:Destroy()
7174 end
7175 if cl2 then
7176 cl2:Destroy()
7177 end
7178 end
7179end)
7180
7181LocalObjects = {}
7182function SetLocalTransparency(Table)
7183 for i, v in pairs(LocalObjects) do
7184 if v.Object == Table.Object then
7185 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
7186 table.remove(LocalObjects, i)
7187 end
7188 end
7189 if not Table.Transparency then
7190 return
7191 end
7192 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
7193 table.insert(LocalObjects, Table)
7194 if ModifyTransparency then
7195 ModifyTransparency:disconnect()
7196 end
7197 ModifyTransparency = RunService.RenderStepped:connect(function()
7198 for i, v in pairs(LocalObjects) do
7199 if v.Object and v.Object.Parent then
7200 local CurrentTransparency = v.Object.LocalTransparencyModifier
7201 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
7202 v.Object.LocalTransparencyModifier = v.Transparency
7203 end
7204 else
7205 table.remove(LocalObjects, i)
7206 end
7207 end
7208 end)
7209end
7210
7211local function SetupJoints()
7212 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
7213 return -- TODO: Make tracking compatible with R15
7214 end
7215 torso = character:FindFirstChild("Torso")
7216
7217 Neck = torso.Neck
7218 OldNeckC0 = Neck.C0
7219 OldNeckC1 = Neck.C1
7220 Shoulder = torso['Right Shoulder']
7221 Shoulder2 = torso['Left Shoulder']
7222 OldShoulderC0 = Shoulder.C0
7223 OldShoulderC1 = Shoulder.C1
7224 OldShoulder2C0 = Shoulder2.C0
7225 OldShoulder2C1 = Shoulder2.C1
7226end
7227
7228local function visual()
7229 if Tool then
7230 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
7231 Color = Instance.new("ColorCorrectionEffect")
7232 Color.Name = "KillColor"
7233 Color.Saturation = -0.5
7234 Color.Parent = game.Workspace.CurrentCamera
7235 game.Debris:AddItem(Color, 0.22)
7236 Blur = Instance.new("BlurEffect")
7237 Blur.Name = "KillBlur"
7238 Blur.Size = 8
7239 Blur.Parent = game.Workspace.CurrentCamera
7240 game.Debris:AddItem(Blur, 0.22)
7241 Tool.GetKill:Destroy()
7242 end
7243
7244 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
7245 Color = Instance.new("ColorCorrectionEffect")
7246 Color.Name = "KillColor"
7247 Color.Saturation = -0.75
7248 Color.TintColor = Color3.new(1, 0.9, 0.9)
7249 Color.Parent = game.Workspace.CurrentCamera
7250 game.Debris:AddItem(Color, 0.22)
7251 Blur = Instance.new("BlurEffect")
7252 Blur.Name = "KillBlur"
7253 Blur.Size = 8
7254 Blur.Parent = game.Workspace.CurrentCamera
7255 game.Debris:AddItem(Blur, 0.22)
7256 Tool.GetHeadKill:Destroy()
7257 end
7258 end
7259
7260 --player.CameraMode = Enum.CameraMode.LockFirstPerson
7261
7262end
7263
7264SetupJoints()
7265
7266game:GetService("RunService").RenderStepped:connect(function()
7267 if character and humanoid.Health > 0 and script.Parent.Parent == character then
7268 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
7269 Tool = character:FindFirstChildOfClass("Tool")
7270 visual()
7271 else
7272 Tool = nil
7273 end
7274 if Tool and Tool.Enabled == true then
7275 character.Humanoid.AutoRotate = false
7276
7277 mouse.TargetFilter = game.Workspace
7278 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
7279 --game.Workspace.CurrentCamera.CameraSubject = character.Head
7280 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
7281 --end
7282
7283 character['Torso'].Neck.C0 = OldNeckC0
7284 character['Torso'].Neck.C1 = OldNeckC1
7285 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7286 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7287 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7288 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7289
7290 local toMouse = (mouse.Hit.p - character.Head.Position).unit
7291 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
7292 local neckAngle = angle
7293 if math.deg(neckAngle) > 110 then
7294 neckAngle = math.rad(110)
7295 end
7296
7297 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
7298
7299 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
7300 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
7301
7302 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
7303 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
7304 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
7305 end
7306 else
7307 if armgroup then
7308 armgroup:Destroy()
7309 armgroup = nil
7310 end
7311 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
7312 character['Torso'].Neck.C0 = OldNeckC0
7313 character['Torso'].Neck.C1 = OldNeckC1
7314 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7315 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7316 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7317 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7318
7319 character.Humanoid.AutoRotate = true
7320 mouse.TargetFilter = nil
7321
7322 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
7323 for i, v in pairs(character:GetChildren()) do
7324 if v:IsA("BasePart") then
7325 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
7326 end
7327 if v:IsA("Accessory") then
7328 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
7329 end
7330 end
7331 end
7332 end
7333 end
7334end)
7335
7336script.Parent.Unequipped:connect(function()
7337 if armgroup then
7338 armgroup:Destroy()
7339 armgroup = nil
7340 end
7341 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
7342 character['Torso'].Neck.C0 = OldNeckC0
7343 character['Torso'].Neck.C1 = OldNeckC1
7344 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7345 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7346 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7347 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7348
7349 character.Humanoid.AutoRotate = true
7350 mouse.TargetFilter = nil
7351
7352 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
7353 for i, v in pairs(character:GetChildren()) do
7354 if v:IsA("BasePart") then
7355 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
7356 end
7357 if v:IsA("Accessory") then
7358 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
7359 end
7360 end
7361 end
7362end)
7363end))
7364LocalScript11.Name = "AssaultRifleScript"
7365LocalScript11.Parent = Tool0
7366table.insert(cors,sandbox(LocalScript11,function()
7367--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
7368-- Waits for the child of the specified parent
7369local function WaitForChild(parent, childName)
7370 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
7371 return parent[childName]
7372end
7373
7374----- MAGIC NUMBERS ABOUT THE TOOL -----
7375local Auto = false
7376local ShotgunShots = 12
7377-- How much damage a bullet does
7378local Damage = 22
7379local HeadMultiplier = 1.65
7380-- How many times per second the gun can fire
7381local FireRate = 0.35
7382-- The maximum distance the can can shoot, this value should never go above 1000
7383local Range = 400
7384-- In radians the minimum accuracy penalty
7385local MinSpread = 0.075
7386-- In radian the maximum accuracy penalty
7387local MaxSpread = 0.075
7388-- Number of bullets in a clip
7389local ClipSize = 8
7390-- DefaultValue for spare ammo
7391local SpareAmmo = 160
7392-- The amount the aim will increase or decrease by
7393-- decreases this number reduces the speed that recoil takes effect
7394local AimInaccuracyStepAmount = 0.0125
7395-- Time it takes to reload weapon
7396local ReloadTime = 3
7397----------------------------------------
7398
7399-- Colors
7400local FriendlyReticleColor = Color3.new(0, 1, 0)
7401local EnemyReticleColor = Color3.new(1, 0, 0)
7402local NeutralReticleColor = Color3.new(1, 1, 1)
7403
7404local Spread = MinSpread
7405local AmmoInClip = ClipSize
7406
7407local Tool = script.Parent
7408local Handle = WaitForChild(Tool, 'Handle')
7409local WeaponGui = nil
7410
7411local LeftButtonDown
7412local Reloading = false
7413local IsShooting = false
7414
7415-- Player specific convenience variables
7416local MyPlayer = nil
7417local MyCharacter = nil
7418local MyHumanoid = nil
7419local MyTorso = nil
7420local MyMouse = nil
7421
7422local RecoilAnim
7423local RecoilTrack = nil
7424
7425local IconURL = Tool.TextureId -- URL to the weapon icon asset
7426
7427local DebrisService = game:GetService('Debris')
7428local PlayersService = game:GetService('Players')
7429
7430
7431local FireSound
7432
7433local OnFireConnection = nil
7434local OnReloadConnection = nil
7435
7436local DecreasedAimLastShot = false
7437local LastSpreadUpdate = time()
7438
7439-- this is a dummy object that holds the flash made when the gun is fired
7440local FlashHolder = nil
7441
7442
7443local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
7444local GetCellFunction = Workspace.Terrain.GetCell
7445
7446function RayIgnoreCheck(hit, pos)
7447 if hit then
7448 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
7449 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
7450 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
7451 return true
7452 elseif hit:IsA('Terrain') and pos then
7453 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
7454 if cellPos then
7455 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
7456 if cellMat and cellMat == Enum.CellMaterial.Water then
7457 return true
7458 end
7459 end
7460 end
7461 end
7462 return false
7463end
7464
7465-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
7466function RayCast(startPos, vec, rayLength)
7467 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
7468 if hitObject and hitPos then
7469 local distance = rayLength - (hitPos - startPos).magnitude
7470 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
7471 -- there is a chance here for potential infinite recursion
7472 return RayCast(hitPos, vec, distance)
7473 end
7474 end
7475 return hitObject, hitPos
7476end
7477
7478
7479
7480function TagHumanoid(humanoid, player)
7481 -- Add more tags here to customize what tags are available.
7482 while humanoid:FindFirstChild('creator') do
7483 humanoid:FindFirstChild('creator'):Destroy()
7484 end
7485 local creatorTag = Instance.new("ObjectValue")
7486 creatorTag.Value = player
7487 creatorTag.Name = "creator"
7488 creatorTag.Parent = humanoid
7489 DebrisService:AddItem(creatorTag, 1.5)
7490
7491 local weaponIconTag = Instance.new("StringValue")
7492 weaponIconTag.Value = IconURL
7493 weaponIconTag.Name = "icon"
7494 weaponIconTag.Parent = creatorTag
7495end
7496
7497local function CreateFlash()
7498 Handle.Light.Enabled = true
7499 delay(0.01, function()
7500 Handle.Light.Enabled = false
7501 end)
7502 if FlashHolder then
7503 if not flash then
7504 flash = Instance.new('Fire', FlashHolder)
7505 flash.Color = Color3.new(1, 140 / 255, 0)
7506 flash.SecondaryColor = Color3.new(1, 0, 0)
7507 flash.Heat = 0
7508 flash.Size = 0.3
7509 delay(0.02, function()
7510 flash.Enabled = false
7511 end)
7512 else
7513 flash.Enabled = true
7514 delay(0.02, function()
7515 flash.Enabled = false
7516 end)
7517 end
7518 else
7519 FlashHolder = Instance.new("Part", Tool)
7520 FlashHolder.Transparency = 1
7521 FlashHolder.CanCollide= false
7522 FlashHolder.Size = Vector3.new(1, 1, 1)
7523 FlashHolder.Position = Tool.Handle.Position
7524 local Weld = Instance.new("ManualWeld")
7525 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
7526 Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
7527 Weld.Part0 = FlashHolder
7528 Weld.Part1 = Tool.Handle
7529 Weld.Parent = FlashHolder
7530 end
7531end
7532
7533local function CreateBullet(bulletPos)
7534 local bullet = Instance.new('Part', Workspace)
7535 bullet.FormFactor = Enum.FormFactor.Custom
7536 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
7537 bullet.BrickColor = BrickColor.new("Really black")
7538 bullet.Material = "Neon"
7539 bullet.Shape = Enum.PartType.Ball
7540 bullet.CanCollide = false
7541 bullet.CFrame = CFrame.new(bulletPos)
7542 bullet.Anchored = true
7543 bullet.TopSurface = Enum.SurfaceType.Smooth
7544 bullet.BottomSurface = Enum.SurfaceType.Smooth
7545 bullet.Name = 'Bullet'
7546 DebrisService:AddItem(bullet, 2.5)
7547 --[[local fire = Instance.new("Fire", bullet)
7548 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
7549 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
7550 fire.Size = 1
7551 fire.Heat = 0
7552 DebrisService:AddItem(fire, 0.1)]]--
7553 return bullet
7554end
7555
7556local function weldBetween(a, b)
7557 local weld = Instance.new("Weld")
7558 weld.Part0 = a
7559 weld.Part1 = b
7560 weld.C0 = CFrame.new()
7561 weld.C1 = b.CFrame:inverse() * a.CFrame
7562 weld.Parent = a
7563 return weld;
7564end
7565
7566local function Reload()
7567 if not Reloading and stance == false then
7568 Reloading = true
7569 if AmmoInClip ~= 0 then
7570 full = true
7571 else
7572 full = false
7573 end
7574 -- Don't reload if you are already full or have no extra ammo
7575 if AmmoInClip ~= ClipSize then
7576 if PumpTrack then
7577 PumpTrack:Stop()
7578 end
7579 for i = 1,ClipSize-AmmoInClip do
7580 if PumpTrack then
7581 PumpTrack:Play()
7582 end
7583 if Handle:FindFirstChild('PumpSound') then
7584 Handle.InsertSound:Play()
7585 end
7586 AmmoInClip = AmmoInClip + 1
7587 UpdateAmmo(AmmoInClip+1)
7588 wait(0.5)
7589 end
7590 if full == false then
7591 if PumpTrack then
7592 PumpTrack:Play()
7593 end
7594 if Handle:FindFirstChild('PumpSound') then
7595 Handle.PumpSound:Play()
7596 end
7597 wait(0.5)
7598 end
7599 -- Only use as much ammo as you have
7600 local ammoToUse = ClipSize - AmmoInClip
7601 AmmoInClip = AmmoInClip + ammoToUse
7602 UpdateAmmo(AmmoInClip)
7603 end
7604 Reloading = false
7605 end
7606end
7607
7608function OnFire()
7609 if IsShooting or stance == true then return end
7610 if MyHumanoid and MyHumanoid.Health > 0 then
7611 IsShooting = true
7612 if AmmoInClip == 0 then
7613 Handle.Empty:Play()
7614 end
7615 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
7616 if Auto == false then
7617 LeftButtonDown = false
7618 end
7619 RecoilTrack:Play()
7620 if Spread and not DecreasedAimLastShot then
7621 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
7622 UpdateCrosshair(Spread)
7623 end
7624 DecreasedAimLastShot = not DecreasedAimLastShot
7625 if Handle:FindFirstChild('FireSound') then
7626 Handle.FireSound:Play()
7627 end
7628 CreateFlash()
7629 for i = 1, ShotgunShots do
7630 if MyMouse then
7631 local targetPoint = MyMouse.Hit.p
7632 local shootDirection = (targetPoint - Handle.Position).unit
7633 -- Adjust the shoot direction randomly off by a little bit to account for recoil
7634 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
7635 (0.5 - math.random()) * 2 * Spread,
7636 (0.5 - math.random()) * 2 * Spread) * shootDirection
7637 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
7638 local bullet
7639 -- Create a bullet here
7640 if hitObject then
7641 bullet = CreateBullet(bulletPos)
7642 end
7643 if hitObject and hitObject.Parent then
7644 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
7645 if hitHumanoid then
7646 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
7647 TagHumanoid(hitHumanoid, MyPlayer)
7648 if hitObject.Name == "Head" then
7649 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
7650 else
7651 hitHumanoid:TakeDamage(Damage)
7652 end
7653 if bullet then
7654 bullet:Destroy()
7655 bullet = nil
7656 --bullet.Transparency = 1
7657 end
7658 Spawn(UpdateTargetHit)
7659 end
7660 end
7661 end
7662 end
7663 AmmoInClip = AmmoInClip - 1
7664 UpdateAmmo(AmmoInClip)
7665
7666 wait(0.15)
7667 if RecoilTrack then
7668 RecoilTrack:Stop()
7669 end
7670 wait(0.15)
7671 if AmmoInClip > 0 then
7672 if PumpTrack then
7673 PumpTrack:Play()
7674 end
7675 if Handle:FindFirstChild('PumpSound') then
7676 Handle.PumpSound:Play()
7677 end
7678 wait(.1)
7679 local CasingBase = Instance.new('Part')
7680CasingBase.FormFactor = Enum.FormFactor.Custom
7681CasingBase.Elasticity = 0
7682CasingBase.Size = Vector3.new(.3,.3,.5)
7683local CasingMesh = Instance.new('SpecialMesh')
7684CasingMesh.MeshId = 'http://www.roblox.com/asset/?id=94248124'
7685CasingMesh.TextureId = 'http://www.roblox.com/asset/?id=94219470'
7686--CasingMesh.Scale = Vector3.new(.75,.75,.75)
7687CasingMesh.Parent = CasingBase
7688
7689 local casing = CasingBase
7690 casing.Position = Tool.Handle.Position + Vector3.new(0,0,0)
7691 casing.Velocity = (Vector3.new((math.random()-.5),(.5+math.random()),(math.random()-.5)) - 1*(Tool.Handle.CFrame * CFrame.Angles(0,math.pi/4,0)).lookVector)*20
7692 DebrisService:AddItem(casing, 2.5)
7693 casing.Parent = game.Workspace
7694 end
7695 wait(FireRate)
7696 end
7697 IsShooting = false
7698 if RecoilTrack then
7699 RecoilTrack:Stop()
7700 end
7701 end
7702end
7703
7704local TargetHits = 0
7705function UpdateTargetHit()
7706 TargetHits = TargetHits + 1
7707 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
7708 WeaponGui.Crosshair.TargetHitImage.Visible = true
7709 end
7710 wait(0.5)
7711 TargetHits = TargetHits - 1
7712 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
7713 WeaponGui.Crosshair.TargetHitImage.Visible = false
7714 end
7715end
7716
7717function UpdateCrosshair(value, mouse)
7718 if WeaponGui then
7719 local absoluteY = 650
7720 WeaponGui.Crosshair:TweenSize(
7721 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
7722 Enum.EasingDirection.Out,
7723 Enum.EasingStyle.Linear,
7724 0.33)
7725 end
7726end
7727
7728function UpdateAmmo(value)
7729 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
7730 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
7731 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
7732 WeaponGui.Crosshair.ReloadingLabel.Visible = false
7733 end
7734 end
7735 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
7736 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
7737 end
7738end
7739
7740
7741function OnMouseDown()
7742 LeftButtonDown = true
7743 OnFire()
7744end
7745
7746function OnMouseUp()
7747 LeftButtonDown = false
7748end
7749
7750function safety()
7751 if stance == false and not Reloading then
7752 stance = true
7753 Tool.Enabled = false
7754 passive:Play()
7755 else
7756 stance = false
7757 Tool.Enabled = true
7758 if passive then
7759 passive:Stop()
7760 end
7761 end
7762end
7763
7764function OnKeyDown(key)
7765 if string.lower(key) == 'r' then
7766 Reload()
7767 end
7768 if string.lower(key) == 'q' then
7769 safety()
7770 end
7771end
7772
7773
7774function OnEquipped(mouse)
7775 RecoilAnim = WaitForChild(Tool, 'FireAni')
7776 PumpAnim = WaitForChild(Tool, 'Reload')
7777 FireSound = WaitForChild(Handle, 'FireSound')
7778
7779 MyCharacter = Tool.Parent
7780 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
7781 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
7782 MyTorso = MyCharacter:FindFirstChild('Torso')
7783 MyMouse = mouse
7784 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
7785 if WeaponGui and MyPlayer then
7786 WeaponGui.Parent = MyPlayer.PlayerGui
7787 UpdateAmmo(AmmoInClip)
7788 end
7789 if RecoilAnim then
7790 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
7791 end
7792 if PumpAnim then
7793 PumpTrack = MyHumanoid:LoadAnimation(PumpAnim)
7794 end
7795 idle = MyHumanoid:LoadAnimation(Tool.idle)
7796 idle:Play()
7797 gunidleanim = Instance.new("Animation")
7798 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
7799 passive = MyHumanoid:LoadAnimation(gunidleanim)
7800
7801 stance = false
7802 Tool.Enabled = true
7803
7804 if MyMouse then
7805 -- Disable mouse icon
7806 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
7807 MyMouse.Button1Down:connect(OnMouseDown)
7808 MyMouse.Button1Up:connect(OnMouseUp)
7809 MyMouse.KeyDown:connect(OnKeyDown)
7810 end
7811end
7812
7813
7814-- Unequip logic here
7815function OnUnequipped()
7816 if idle then
7817 idle:Stop()
7818 end
7819 if passive then
7820 passive:Stop()
7821 end
7822 LeftButtonDown = false
7823 Reloading = false
7824 MyCharacter = nil
7825 MyHumanoid = nil
7826 MyTorso = nil
7827 MyPlayer = nil
7828 MyMouse = nil
7829 if OnFireConnection then
7830 OnFireConnection:disconnect()
7831 end
7832 if OnReloadConnection then
7833 OnReloadConnection:disconnect()
7834 end
7835 if FlashHolder then
7836 FlashHolder = nil
7837 end
7838 if WeaponGui then
7839 WeaponGui.Parent = nil
7840 WeaponGui = nil
7841 end
7842 if RecoilTrack then
7843 RecoilTrack:Stop()
7844 end
7845 if PumpTrack then
7846 PumpTrack:Stop()
7847 end
7848end
7849
7850local function SetReticleColor(color)
7851 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
7852 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
7853 if line:IsA('Frame') then
7854 line.BorderColor3 = color
7855 end
7856 end
7857 end
7858end
7859
7860
7861Tool.Equipped:connect(OnEquipped)
7862Tool.Unequipped:connect(OnUnequipped)
7863
7864while true do
7865 wait(0.033)
7866 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
7867 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
7868 SetReticleColor(NeutralReticleColor)
7869
7870 local target = MyMouse.Target
7871 if target and target.Parent then
7872 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
7873 if player then
7874 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
7875 SetReticleColor(EnemyReticleColor)
7876 else
7877 SetReticleColor(FriendlyReticleColor)
7878 end
7879 end
7880 end
7881 end
7882 if Spread and not IsShooting then
7883 local currTime = time()
7884 if currTime - LastSpreadUpdate > FireRate * 2 then
7885 LastSpreadUpdate = currTime
7886 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
7887 UpdateCrosshair(Spread, MyMouse)
7888 end
7889 end
7890end
7891end))
7892ScreenGui12.Name = "WeaponHud"
7893ScreenGui12.Parent = Tool0
7894Frame13.Name = "Crosshair"
7895Frame13.Parent = ScreenGui12
7896Frame13.Transparency = 1
7897Frame13.Size = UDim2.new(0, 150, 0, 150)
7898Frame13.Position = UDim2.new(0, 500, 0, 500)
7899Frame13.Visible = false
7900Frame13.BackgroundColor3 = Color3.new(0, 1, 0)
7901Frame13.BackgroundTransparency = 1
7902Frame13.BorderSizePixel = 0
7903Frame14.Name = "TopFrame"
7904Frame14.Parent = Frame13
7905Frame14.Size = UDim2.new(0, 2, 0, 14)
7906Frame14.Position = UDim2.new(0, -1, -0.5, -7)
7907Frame14.BackgroundColor3 = Color3.new(0, 0, 0)
7908Frame14.BorderColor3 = Color3.new(0, 1, 0)
7909Frame15.Name = "BottomFrame"
7910Frame15.Parent = Frame13
7911Frame15.Size = UDim2.new(0, 2, 0, 14)
7912Frame15.Position = UDim2.new(0, -1, 0.5, -7)
7913Frame15.BackgroundColor3 = Color3.new(0, 0, 0)
7914Frame15.BorderColor3 = Color3.new(0, 1, 0)
7915Frame16.Name = "RightFrame"
7916Frame16.Parent = Frame13
7917Frame16.Size = UDim2.new(0, 14, 0, 2)
7918Frame16.Position = UDim2.new(0.5, -7, 0, -1)
7919Frame16.BackgroundColor3 = Color3.new(0, 0, 0)
7920Frame16.BorderColor3 = Color3.new(0, 1, 0)
7921Frame17.Name = "LeftFrame"
7922Frame17.Parent = Frame13
7923Frame17.Size = UDim2.new(0, 14, 0, 2)
7924Frame17.Position = UDim2.new(-0.5, -7, 0, -1)
7925Frame17.BackgroundColor3 = Color3.new(0, 0, 0)
7926Frame17.BorderColor3 = Color3.new(0, 1, 0)
7927ImageLabel18.Name = "TargetHitImage"
7928ImageLabel18.Parent = Frame13
7929ImageLabel18.Transparency = 1
7930ImageLabel18.Size = UDim2.new(0, 50, 0, 50)
7931ImageLabel18.Position = UDim2.new(0, -25, 0, -25)
7932ImageLabel18.Visible = false
7933ImageLabel18.BackgroundTransparency = 1
7934ImageLabel18.BorderSizePixel = 0
7935ImageLabel18.Image = "http://www.roblox.com/asset/?id=69368028"
7936TextLabel19.Name = "ReloadingLabel"
7937TextLabel19.Parent = Frame13
7938TextLabel19.Transparency = 1
7939TextLabel19.Text = "Reloading"
7940TextLabel19.Position = UDim2.new(0, 20, 0, -20)
7941TextLabel19.Visible = false
7942TextLabel19.BackgroundTransparency = 1
7943TextLabel19.BorderSizePixel = 0
7944TextLabel19.Font = Enum.Font.ArialBold
7945TextLabel19.FontSize = Enum.FontSize.Size18
7946TextLabel19.TextColor3 = Color3.new(0, 0, 0)
7947TextLabel19.TextStrokeColor3 = Color3.new(0, 1, 0)
7948TextLabel19.TextStrokeTransparency = 0
7949TextLabel19.TextTransparency = 1
7950TextLabel19.TextXAlignment = Enum.TextXAlignment.Left
7951TextLabel19.TextYAlignment = Enum.TextYAlignment.Bottom
7952Frame20.Name = "AmmoHud"
7953Frame20.Parent = ScreenGui12
7954Frame20.Transparency = 1
7955Frame20.Size = UDim2.new(0, 200, 0, 50)
7956Frame20.Position = UDim2.new(1, -265, 1, -60)
7957Frame20.BackgroundTransparency = 1
7958Frame20.BorderSizePixel = 0
7959TextLabel21.Name = "ForwardSlash"
7960TextLabel21.Parent = Frame20
7961TextLabel21.Transparency = 0
7962TextLabel21.Text = "/"
7963TextLabel21.Position = UDim2.new(0.5, 0, 0.5, 0)
7964TextLabel21.BackgroundTransparency = 1
7965TextLabel21.BorderSizePixel = 0
7966TextLabel21.Font = Enum.Font.Arial
7967TextLabel21.FontSize = Enum.FontSize.Size48
7968TextLabel21.TextColor3 = Color3.new(1, 1, 1)
7969TextLabel22.Name = "ClipAmmo"
7970TextLabel22.Parent = Frame20
7971TextLabel22.Transparency = 0
7972TextLabel22.Text = "54"
7973TextLabel22.Position = UDim2.new(0.449999988, 0, 0.5, 0)
7974TextLabel22.BackgroundTransparency = 1
7975TextLabel22.BorderSizePixel = 0
7976TextLabel22.Font = Enum.Font.Arial
7977TextLabel22.FontSize = Enum.FontSize.Size48
7978TextLabel22.TextColor3 = Color3.new(1, 1, 1)
7979TextLabel22.TextXAlignment = Enum.TextXAlignment.Right
7980TextLabel23.Name = "TotalAmmo"
7981TextLabel23.Parent = Frame20
7982TextLabel23.Transparency = 0
7983TextLabel23.Text = "180"
7984TextLabel23.Position = UDim2.new(0.550000012, 0, 0.5, 0)
7985TextLabel23.BackgroundTransparency = 1
7986TextLabel23.BorderSizePixel = 0
7987TextLabel23.Font = Enum.Font.Arial
7988TextLabel23.FontSize = Enum.FontSize.Size48
7989TextLabel23.TextColor3 = Color3.new(1, 1, 1)
7990TextLabel23.TextXAlignment = Enum.TextXAlignment.Left
7991Animation24.Name = "FireAni"
7992Animation24.Parent = Tool0
7993Animation24.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
7994Animation25.Name = "Reload"
7995Animation25.Parent = Tool0
7996Animation25.AnimationId = "rbxassetid://94245658"
7997Animation26.Name = "idle"
7998Animation26.Parent = Tool0
7999Animation26.AnimationId = "rbxassetid://94242777"
8000for i,v in pairs(mas:GetChildren()) do
8001 v.Parent = game:GetService("Players").LocalPlayer.Backpack
8002 pcall(function() v:MakeJoints() end)
8003end
8004mas:Destroy()
8005for i,v in pairs(cors) do
8006 spawn(function()
8007 pcall(v)
8008 end)
8009end