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