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