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