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