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