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