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