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