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