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