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