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