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