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