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