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