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