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