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