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