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