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