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