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