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