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