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