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