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