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