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