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