· 6 years ago · Nov 10, 2019, 01:28 PM
1function sandbox(var,func)
2 local env = getfenv(func)
3 local newenv = setmetatable({},{
4 __index = function(self,k)
5 if k=="script" then
6 return var
7 else
8 return env[k]
9 end
10 end,
11 })
12 setfenv(func,newenv)
13 return func
14end
15cors = {}
16mas = Instance.new("Model",game:GetService("Lighting"))
17Tool0 = Instance.new("Tool")
18Part1 = Instance.new("Part")
19Part2 = Instance.new("Part")
20BlockMesh3 = Instance.new("BlockMesh")
21Part4 = Instance.new("Part")
22ParticleEmitter5 = Instance.new("ParticleEmitter")
23ParticleEmitter6 = Instance.new("ParticleEmitter")
24PointLight7 = Instance.new("PointLight")
25Part8 = Instance.new("Part")
26BlockMesh9 = Instance.new("BlockMesh")
27Sound10 = Instance.new("Sound")
28Sound11 = Instance.new("Sound")
29Sound12 = Instance.new("Sound")
30MeshPart13 = Instance.new("MeshPart")
31MeshPart14 = Instance.new("MeshPart")
32MeshPart15 = Instance.new("MeshPart")
33IntValue16 = Instance.new("IntValue")
34IntValue17 = Instance.new("IntValue")
35Script18 = Instance.new("Script")
36NumberValue19 = Instance.new("NumberValue")
37Script20 = Instance.new("Script")
38ObjectValue21 = Instance.new("ObjectValue")
39RemoteFunction22 = Instance.new("RemoteFunction")
40RemoteFunction23 = Instance.new("RemoteFunction")
41RemoteFunction24 = Instance.new("RemoteFunction")
42RemoteEvent25 = Instance.new("RemoteEvent")
43RemoteFunction26 = Instance.new("RemoteFunction")
44RemoteFunction27 = Instance.new("RemoteFunction")
45RemoteFunction28 = Instance.new("RemoteFunction")
46LocalScript29 = Instance.new("LocalScript")
47IntValue30 = Instance.new("IntValue")
48RemoteEvent31 = Instance.new("RemoteEvent")
49RemoteEvent32 = Instance.new("RemoteEvent")
50RemoteEvent33 = Instance.new("RemoteEvent")
51RemoteEvent34 = Instance.new("RemoteEvent")
52LocalScript35 = Instance.new("LocalScript")
53IntValue36 = Instance.new("IntValue")
54Folder37 = Instance.new("Folder")
55ModuleScript38 = Instance.new("ModuleScript")
56ModuleScript39 = Instance.new("ModuleScript")
57ScreenGui40 = Instance.new("ScreenGui")
58Frame41 = Instance.new("Frame")
59Frame42 = Instance.new("Frame")
60TextLabel43 = Instance.new("TextLabel")
61TextLabel44 = Instance.new("TextLabel")
62TextLabel45 = Instance.new("TextLabel")
63Frame46 = Instance.new("Frame")
64TextLabel47 = Instance.new("TextLabel")
65TextLabel48 = Instance.new("TextLabel")
66Frame49 = Instance.new("Frame")
67Frame50 = Instance.new("Frame")
68ImageLabel51 = Instance.new("ImageLabel")
69TextLabel52 = Instance.new("TextLabel")
70TextLabel53 = Instance.new("TextLabel")
71Frame54 = Instance.new("Frame")
72ImageLabel55 = Instance.new("ImageLabel")
73TextLabel56 = Instance.new("TextLabel")
74TextLabel57 = Instance.new("TextLabel")
75Frame58 = Instance.new("Frame")
76TextLabel59 = Instance.new("TextLabel")
77Frame60 = Instance.new("Frame")
78Frame61 = Instance.new("Frame")
79Frame62 = Instance.new("Frame")
80Frame63 = Instance.new("Frame")
81Frame64 = Instance.new("Frame")
82Frame65 = Instance.new("Frame")
83Frame66 = Instance.new("Frame")
84Frame67 = Instance.new("Frame")
85Frame68 = Instance.new("Frame")
86Frame69 = Instance.new("Frame")
87Frame70 = Instance.new("Frame")
88Frame71 = Instance.new("Frame")
89Frame72 = Instance.new("Frame")
90Frame73 = Instance.new("Frame")
91Frame74 = Instance.new("Frame")
92Frame75 = Instance.new("Frame")
93Frame76 = Instance.new("Frame")
94Frame77 = Instance.new("Frame")
95Frame78 = Instance.new("Frame")
96Frame79 = Instance.new("Frame")
97Frame80 = Instance.new("Frame")
98Frame81 = Instance.new("Frame")
99Frame82 = Instance.new("Frame")
100Frame83 = Instance.new("Frame")
101Frame84 = Instance.new("Frame")
102Frame85 = Instance.new("Frame")
103TextLabel86 = Instance.new("TextLabel")
104TextLabel87 = Instance.new("TextLabel")
105TextLabel88 = Instance.new("TextLabel")
106Frame89 = Instance.new("Frame")
107TextLabel90 = Instance.new("TextLabel")
108TextLabel91 = Instance.new("TextLabel")
109ImageLabel92 = Instance.new("ImageLabel")
110NumberValue93 = Instance.new("NumberValue")
111TextLabel94 = Instance.new("TextLabel")
112Frame95 = Instance.new("Frame")
113TextLabel96 = Instance.new("TextLabel")
114Frame97 = Instance.new("Frame")
115ImageLabel98 = Instance.new("ImageLabel")
116ImageLabel99 = Instance.new("ImageLabel")
117Frame100 = Instance.new("Frame")
118Frame101 = Instance.new("Frame")
119LocalScript102 = Instance.new("LocalScript")
120Frame103 = Instance.new("Frame")
121Frame104 = Instance.new("Frame")
122ImageLabel105 = Instance.new("ImageLabel")
123ImageLabel106 = Instance.new("ImageLabel")
124TextLabel107 = Instance.new("TextLabel")
125Frame108 = Instance.new("Frame")
126ImageLabel109 = Instance.new("ImageLabel")
127TextLabel110 = Instance.new("TextLabel")
128Frame111 = Instance.new("Frame")
129TextLabel112 = Instance.new("TextLabel")
130Frame113 = Instance.new("Frame")
131TextLabel114 = Instance.new("TextLabel")
132Frame115 = Instance.new("Frame")
133TextLabel116 = Instance.new("TextLabel")
134Frame117 = Instance.new("Frame")
135TextLabel118 = Instance.new("TextLabel")
136ModuleScript119 = Instance.new("ModuleScript")
137ModuleScript120 = Instance.new("ModuleScript")
138ModuleScript121 = Instance.new("ModuleScript")
139MeshPart122 = Instance.new("MeshPart")
140Camera123 = Instance.new("Camera")
141Tool0.Name = "AK47"
142Tool0.Parent = mas
143Part1.Name = "Chamber"
144Part1.Parent = Tool0
145Part1.CFrame = CFrame.new(5.21702623, 1.35178494, -45.1210327, 0.707131743, 0.707088411, -3.09869647e-05, -0.707086861, 0.707130134, 3.06743204e-05, 4.36045229e-05, 2.01165676e-07, 1.0000087)
146Part1.Orientation = Vector3.new(0, 0, -45)
147Part1.Position = Vector3.new(5.21702623, 1.35178494, -45.1210327)
148Part1.Rotation = Vector3.new(0, 0, -45)
149Part1.Color = Color3.new(1, 1, 0)
150Part1.Transparency = 1
151Part1.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
152Part1.Anchored = true
153Part1.BottomSurface = Enum.SurfaceType.Smooth
154Part1.BrickColor = BrickColor.new("New Yeller")
155Part1.CanCollide = false
156Part1.Material = Enum.Material.Metal
157Part1.TopSurface = Enum.SurfaceType.Smooth
158Part1.brickColor = BrickColor.new("New Yeller")
159Part1.FormFactor = Enum.FormFactor.Custom
160Part1.formFactor = Enum.FormFactor.Custom
161Part2.Name = "SightMark"
162Part2.Parent = Tool0
163Part2.CFrame = CFrame.new(3.02505493, 1.63371897, -45.2290649, 0.0370121263, 1.49825937e-07, -0.999322295, -2.72973494e-07, 1, 1.39817075e-07, 0.999322295, 2.67608442e-07, 0.0370121263)
164Part2.Orientation = Vector3.new(0, -87.8799973, 0)
165Part2.Position = Vector3.new(3.02505493, 1.63371897, -45.2290649)
166Part2.Rotation = Vector3.new(0, -87.8899994, 0)
167Part2.Color = Color3.new(0.105882, 0.164706, 0.207843)
168Part2.Transparency = 1
169Part2.Size = Vector3.new(0.290894598, 0.200000003, 0.328429729)
170Part2.Anchored = true
171Part2.BottomSurface = Enum.SurfaceType.Smooth
172Part2.BrickColor = BrickColor.new("Black")
173Part2.CanCollide = false
174Part2.Material = Enum.Material.Metal
175Part2.TopSurface = Enum.SurfaceType.Smooth
176Part2.brickColor = BrickColor.new("Black")
177Part2.FormFactor = Enum.FormFactor.Custom
178Part2.formFactor = Enum.FormFactor.Custom
179BlockMesh3.Parent = Part2
180BlockMesh3.Scale = Vector3.new(1, 0.234592363, 1)
181Part4.Name = "Flame"
182Part4.Parent = Tool0
183Part4.CFrame = CFrame.new(7.71851301, 1.27759397, -45.3691978, 3.7252903e-08, 1.00000477, -2.03087723e-07, 2.1191903e-07, -2.09023796e-07, -1.00000238, -1.00000882, 2.98023224e-08, -1.9788348e-07)
184Part4.Orientation = Vector3.new(90, 90, 0)
185Part4.Position = Vector3.new(7.71851301, 1.27759397, -45.3691978)
186Part4.Rotation = Vector3.new(90, 0, -90)
187Part4.Color = Color3.new(0.854902, 0.521569, 0.254902)
188Part4.Transparency = 1
189Part4.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
190Part4.Anchored = true
191Part4.BottomSurface = Enum.SurfaceType.Smooth
192Part4.BrickColor = BrickColor.new("Bright orange")
193Part4.CanCollide = false
194Part4.TopSurface = Enum.SurfaceType.Smooth
195Part4.brickColor = BrickColor.new("Bright orange")
196Part4.FormFactor = Enum.FormFactor.Custom
197Part4.formFactor = Enum.FormFactor.Custom
198ParticleEmitter5.Name = "1FlashFX[Smoke]"
199ParticleEmitter5.Parent = Part4
200ParticleEmitter5.Speed = NumberRange.new(5, 7)
201ParticleEmitter5.Rotation = NumberRange.new(0, 360)
202ParticleEmitter5.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
203ParticleEmitter5.Enabled = false
204ParticleEmitter5.LightEmission = 0.10000000149012
205ParticleEmitter5.Texture = "http://www.roblox.com/asset/?id=244514423"
206ParticleEmitter5.Transparency = NumberSequence.new(0.60000002384186,1)
207ParticleEmitter5.Size = NumberSequence.new(0,0)
208ParticleEmitter5.Lifetime = NumberRange.new(1.25, 1.5)
209ParticleEmitter5.Rate = 100
210ParticleEmitter5.RotSpeed = NumberRange.new(10, 10)
211ParticleEmitter5.SpreadAngle = Vector2.new(15, 15)
212ParticleEmitter5.VelocitySpread = 15
213ParticleEmitter6.Name = "FlashFX[Flash]"
214ParticleEmitter6.Parent = Part4
215ParticleEmitter6.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
216ParticleEmitter6.Enabled = false
217ParticleEmitter6.LightEmission = 1
218ParticleEmitter6.Texture = "http://www.roblox.com/asset/?id=242102147"
219ParticleEmitter6.Transparency = NumberSequence.new(1,0.89999997615814,0.88749998807907,1)
220ParticleEmitter6.Size = NumberSequence.new(0,0)
221ParticleEmitter6.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
222ParticleEmitter6.Rate = 1000
223ParticleEmitter6.RotSpeed = NumberRange.new(22, 22)
224PointLight7.Name = "FlashFX[Light]"
225PointLight7.Parent = Part4
226PointLight7.Color = Color3.new(1, 1, 0.498039)
227PointLight7.Enabled = false
228PointLight7.Range = 0
229PointLight7.Brightness = 10
230Part8.Name = "Handle"
231Part8.Parent = Tool0
232Part8.CFrame = CFrame.new(4.43412018, 0.685002029, -45.2366943, -3.7252903e-08, 9.87790258e-08, -1.00000477, -3.62917007e-07, 1.00000238, 1.04715667e-07, 1.00000882, 3.488814e-07, -2.98023224e-08)
233Part8.Orientation = Vector3.new(0, -90, 0)
234Part8.Position = Vector3.new(4.43412018, 0.685002029, -45.2366943)
235Part8.Rotation = Vector3.new(0, -90, 0)
236Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
237Part8.Transparency = 1
238Part8.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
239Part8.Anchored = true
240Part8.BottomSurface = Enum.SurfaceType.Smooth
241Part8.BrickColor = BrickColor.new("Dark stone grey")
242Part8.TopSurface = Enum.SurfaceType.Smooth
243Part8.brickColor = BrickColor.new("Dark stone grey")
244Part8.FormFactor = Enum.FormFactor.Custom
245Part8.formFactor = Enum.FormFactor.Custom
246BlockMesh9.Parent = Part8
247BlockMesh9.Scale = Vector3.new(0.905412376, 0.905412376, 0.905412257)
248Sound10.Name = "MagIn"
249Sound10.Parent = Part8
250Sound10.RollOffMode = Enum.RollOffMode.LinearSquare
251Sound10.SoundId = "rbxassetid://456179899"
252Sound10.Volume = 1
253Sound11.Name = "MagOut"
254Sound11.Parent = Part8
255Sound11.RollOffMode = Enum.RollOffMode.LinearSquare
256Sound11.SoundId = "rbxassetid://457042936"
257Sound11.Volume = 1
258Sound12.Name = "Fire"
259Sound12.Parent = Part8
260Sound12.TimePosition = 0.1
261Sound12.MaxDistance = 1000
262Sound12.SoundId = "rbxassetid://168436671"
263Sound12.Volume = 0.40000000596046
264MeshPart13.Name = "Mag"
265MeshPart13.Parent = Tool0
266MeshPart13.CFrame = CFrame.new(5.14322615, 0.585547984, -45.3006973, -0.0322783664, -2.30222653e-07, 0.999484539, 2.18771206e-07, 1, 2.37406567e-07, -0.999484539, 2.26316672e-07, -0.0322783664)
267MeshPart13.Orientation = Vector3.new(0, 91.8499985, 0)
268MeshPart13.Position = Vector3.new(5.14322615, 0.585547984, -45.3006973)
269MeshPart13.Rotation = Vector3.new(-180, 88.1600037, 180)
270MeshPart13.Color = Color3.new(0.105882, 0.164706, 0.207843)
271MeshPart13.Size = Vector3.new(0.200000003, 1.24764788, 0.87799412)
272MeshPart13.Anchored = true
273MeshPart13.BrickColor = BrickColor.new("Black")
274MeshPart13.CanCollide = false
275MeshPart13.Material = Enum.Material.Metal
276MeshPart13.brickColor = BrickColor.new("Black")
277MeshPart13.TextureID = "rbxassetid://430310377"
278MeshPart14.Name = "Bolt"
279MeshPart14.Parent = Tool0
280MeshPart14.CFrame = CFrame.new(4.82769823, 1.38872302, -45.1271057, -0.0322783664, -2.30222653e-07, 0.999484539, 2.18771206e-07, 1, 2.37406567e-07, -0.999484539, 2.26316672e-07, -0.0322783664)
281MeshPart14.Orientation = Vector3.new(0, 91.8499985, 0)
282MeshPart14.Position = Vector3.new(4.82769823, 1.38872302, -45.1271057)
283MeshPart14.Rotation = Vector3.new(-180, 88.1600037, 180)
284MeshPart14.Color = Color3.new(0.105882, 0.164706, 0.207843)
285MeshPart14.Size = Vector3.new(0.240676701, 0.200000003, 0.976980329)
286MeshPart14.Anchored = true
287MeshPart14.BrickColor = BrickColor.new("Black")
288MeshPart14.CanCollide = false
289MeshPart14.Material = Enum.Material.Metal
290MeshPart14.brickColor = BrickColor.new("Black")
291MeshPart14.TextureID = "rbxassetid://430310377"
292MeshPart15.Name = "Body"
293MeshPart15.Parent = Tool0
294MeshPart15.CFrame = CFrame.new(5.04256392, 1.02897799, -45.2974396, -0.032278534, -2.53606665e-08, 0.999484658, 3.91232675e-07, 1, 3.80086433e-08, -0.999484658, 3.92252929e-07, -0.032278534)
295MeshPart15.Orientation = Vector3.new(0, 91.8499985, 0)
296MeshPart15.Position = Vector3.new(5.04256392, 1.02897799, -45.2974396)
297MeshPart15.Rotation = Vector3.new(-180, 88.1600037, 180)
298MeshPart15.Color = Color3.new(0.105882, 0.164706, 0.207843)
299MeshPart15.Size = Vector3.new(0.277274877, 1.13956845, 5.41594219)
300MeshPart15.Anchored = true
301MeshPart15.BrickColor = BrickColor.new("Black")
302MeshPart15.CanCollide = false
303MeshPart15.Material = Enum.Material.Metal
304MeshPart15.brickColor = BrickColor.new("Black")
305MeshPart15.TextureID = "rbxassetid://430310377"
306IntValue16.Name = "Ammo"
307IntValue16.Parent = Tool0
308IntValue16.Value = 30
309IntValue17.Name = "ClipSize"
310IntValue17.Parent = Tool0
311IntValue17.Value = 30
312Script18.Name = "Credits"
313Script18.Parent = Tool0
314table.insert(cors,sandbox(Script18,function()
315--[[
316 ______ ______ __ ______ _ ______
317 / _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
318 / // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
319 / // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
320 / // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
321 /__/__/ /__/__/
322
323--]]
324end))
325NumberValue19.Name = "StoredAmmo"
326NumberValue19.Parent = Tool0
327NumberValue19.Value = inf
328Script20.Name = "serverMain"
329Script20.Parent = Tool0
330table.insert(cors,sandbox(Script20,function()
331local Plyr = script:WaitForChild("Plyr")
332
333local Gun = script.Parent
334local Handle = Gun:WaitForChild("Handle")
335
336local V3 = Vector3.new
337local CF, CFANG = CFrame.new, CFrame.Angles
338
339local RAD = math.rad
340
341local numLerp = function(A, B, Alpha)
342 return A + (B - A) * Alpha
343end
344
345local inList = function(Element, List)
346 for _, v in pairs(List) do
347 if v == Element then
348 return true
349 end
350 end
351 return false
352end
353
354local getObject = function(Model, Class, Name)
355 for _, v in pairs(Model:GetChildren()) do
356 if v:IsA(Class) and v.Name == Name then
357 return v
358 end
359 end
360 return nil
361end
362
363----------------------------------------------------------------------
364--------------------[ IGNORE MODEL HANDLING ]-------------------------
365----------------------------------------------------------------------
366
367wait(math.random(0, 20) / 40) --This is to prevent more than one ignoreModel from being created
368
369if _G.ignoreCode then --If the ignoreCode already exists, then the script creates the ignoreModel
370 --[[
371 The purpose of this is so that every gun in a game that uses this gun kit will share one ignoreModel. That way,
372 bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
373 hit a character part
374 --]]
375 if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
376 local ignoreModel = Instance.new("Model")
377 ignoreModel.Name = "ignoreModel_".._G.ignoreCode
378 ignoreModel.Parent = game.Workspace
379
380 local grenadeFolder = Instance.new("Model")
381 grenadeFolder.Name = "grenadeFolder"
382 grenadeFolder.Parent = ignoreModel
383
384 spawn(function()
385 while true do
386 ignoreModel.Parent = game.Workspace
387 grenadeFolder.Parent = ignoreModel
388 wait(1 / 20)
389 end
390 end)
391 end
392
393 script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
394else
395 --[[
396 If there isn't already an ignoreCode, then this creates one. The purpose of it being random is so that if there is
397 an ignoreModel for something else in the game, the script won't end up placing the ignored objects in that ignoreModel
398 --]]
399 _G.ignoreCode = math.random(1, 1e4)
400
401 if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
402 local ignoreModel = Instance.new("Model")
403 ignoreModel.Name = "ignoreModel_".._G.ignoreCode
404 ignoreModel.Parent = game.Workspace
405
406 local grenadeFolder = Instance.new("Model")
407 grenadeFolder.Name = "grenadeFolder"
408 grenadeFolder.Parent = ignoreModel
409
410 spawn(function()
411 while true do
412 ignoreModel.Parent = game.Workspace
413 grenadeFolder.Parent = ignoreModel
414 wait(1 / 20)
415 end
416 end)
417 end
418
419 script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
420end
421
422spawn(function()
423 --[[
424 This function deletes any Player Folders that were left in the ignoreModel because the player left the game without
425 deselecting the Gun first
426 --]]
427 repeat wait() until _G.ignoreCode
428 local ignoreModel = game.Workspace:WaitForChild("ignoreModel_".._G.ignoreCode)
429 while true do
430 for _, gunIgnore in pairs(ignoreModel:GetChildren()) do
431 if gunIgnore.Name ~= "grenadeFolder" then
432 if (not game.Players:FindFirstChild(gunIgnore.Name:sub(11))) then
433 gunIgnore:Destroy()
434 end
435 end
436 end
437 wait(1 / 20)
438 end
439end)
440
441----------------------------------------------------------------------
442--------------------[ RESET CAMERA ]----------------------------------
443----------------------------------------------------------------------
444
445Gun.ChildRemoved:connect(function(Child)
446 if Child == Handle and Plyr.Value then
447 local ignoreCode = Gun:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value
448 local resetCam = script:WaitForChild("resetCam")
449 resetCam:WaitForChild("ignoreCode").Value = ignoreCode
450 resetCam.Parent = Plyr.Value.PlayerGui
451 end
452end)
453
454----------------------------------------------------------------------
455--------------------[ GET WELD CFRAMES ]------------------------------
456----------------------------------------------------------------------
457
458for _, v in pairs(Gun:GetChildren()) do
459 if v:IsA("BasePart") and v ~= Handle then
460 if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
461 if (not v:FindFirstChild("weldCF")) then
462 local weldCF = Instance.new("CFrameValue")
463 weldCF.Name = "weldCF"
464 weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
465 weldCF.Parent = v
466 end
467 if string.sub(v.Name, 1, 3) == "Mag" then
468 if (not v:FindFirstChild("magTrans")) then
469 local magTrans = Instance.new("NumberValue")
470 magTrans.Name = "magTrans"
471 magTrans.Value = v.Transparency
472 magTrans.Parent = v
473 end
474 end
475 v.Anchored = true
476 v.CanCollide = false
477 end
478end
479Handle.Anchored = false
480Handle.CanCollide = true
481
482----------------------------------------------------------------------
483--------------------[ GUNSETUP HANDLING ]-----------------------------
484----------------------------------------------------------------------
485
486local gunSetup = script:WaitForChild("gunSetup")
487function gunSetup.OnServerInvoke(Player, Vars)
488
489 --------------------[ CREATING IGNORE MODELS ]--------------------------------
490
491 local gunIgnore = Instance.new("Model")
492 gunIgnore.Name = "gunIgnore_"..Player.Name
493 gunIgnore.Parent = Vars.ignoreModel
494
495 --------------------[ MODIFYING THE PLAYER ]----------------------------------
496
497 Vars.Humanoid.AutoRotate = false
498
499 Vars.Shoulders.Right.Part1 = nil
500 Vars.Shoulders.Left.Part1 = nil
501
502 local playerFolder = Instance.new("Model")
503 playerFolder.Name = "playerFolder"
504 playerFolder.Parent = gunIgnore
505
506 local headBase = Instance.new("Part")
507 headBase.Transparency = 1
508 headBase.Name = "headBase"
509 headBase.CanCollide = false
510 headBase.FormFactor = Enum.FormFactor.Custom
511 headBase.Size = V3(0.2, 0.2, 0.2)
512 headBase.BottomSurface = Enum.SurfaceType.Smooth
513 headBase.TopSurface = Enum.SurfaceType.Smooth
514 headBase.Parent = playerFolder
515
516 local headWeld = Instance.new("Weld")
517 headWeld.Part0 = Vars.Torso
518 headWeld.Part1 = headBase
519 headWeld.C0 = CF(0, 1.5, 0)
520 headWeld.Parent = Vars.Torso
521
522 local headWeld2 = Instance.new("Weld")
523 headWeld2.Part0 = headBase
524 headWeld2.Part1 = Vars.Head
525 headWeld2.Parent = headBase
526
527 local animBase = Instance.new("Part")
528 animBase.Transparency = 1
529 animBase.Name = "animBase"
530 animBase.CanCollide = false
531 animBase.FormFactor = Enum.FormFactor.Custom
532 animBase.Size = V3(0.2, 0.2, 0.2)
533 animBase.BottomSurface = Enum.SurfaceType.Smooth
534 animBase.TopSurface = Enum.SurfaceType.Smooth
535 animBase.Parent = playerFolder
536
537 local animWeld = Instance.new("Weld")
538 animWeld.Part0 = animBase
539 animWeld.Part1 = headBase
540 animWeld.Parent = animBase
541
542 local armBase = Instance.new("Part")
543 armBase.Transparency = 1
544 armBase.Name = "ArmBase"
545 armBase.CanCollide = false
546 armBase.FormFactor = Enum.FormFactor.Custom
547 armBase.Size = V3(0.2, 0.2, 0.2)
548 armBase.BottomSurface = Enum.SurfaceType.Smooth
549 armBase.TopSurface = Enum.SurfaceType.Smooth
550 armBase.Parent = playerFolder
551
552 local ABWeld = Instance.new("Weld")
553 ABWeld.Part0 = armBase
554 ABWeld.Part1 = animBase
555 ABWeld.Parent = armBase
556
557 local LArmBase = Instance.new("Part")
558 LArmBase.Transparency = 1
559 LArmBase.Name = "LArmBase"
560 LArmBase.CanCollide = false
561 LArmBase.FormFactor = Enum.FormFactor.Custom
562 LArmBase.Size = V3(0.2, 0.2, 0.2)
563 LArmBase.BottomSurface = Enum.SurfaceType.Smooth
564 LArmBase.TopSurface = Enum.SurfaceType.Smooth
565 LArmBase.Parent = playerFolder
566
567 local RArmBase = Instance.new("Part")
568 RArmBase.Transparency = 1
569 RArmBase.Name = "RArmBase"
570 RArmBase.CanCollide = false
571 RArmBase.FormFactor = Enum.FormFactor.Custom
572 RArmBase.Size = V3(0.2, 0.2, 0.2)
573 RArmBase.BottomSurface = Enum.SurfaceType.Smooth
574 RArmBase.TopSurface = Enum.SurfaceType.Smooth
575 RArmBase.Parent = playerFolder
576
577 local LWeld = Instance.new("Weld")
578 LWeld.Name = "LWeld"
579 LWeld.Part0 = armBase
580 LWeld.Part1 = LArmBase
581 LWeld.C0 = Vars.armC0[1]
582 LWeld.C1 = Vars.leftArmC1
583 LWeld.Parent = armBase
584
585 local RWeld = Instance.new("Weld")
586 RWeld.Name = "RWeld"
587 RWeld.Part0 = armBase
588 RWeld.Part1 = RArmBase
589 RWeld.C0 = Vars.armC0[2]
590 RWeld.C1 = Vars.rightArmC1
591 RWeld.Parent = armBase
592
593 local LWeld2 = Instance.new("Weld")
594 LWeld2.Name = "LWeld"
595 LWeld2.Part0 = LArmBase
596 LWeld2.Part1 = Vars.LArm
597 LWeld2.Parent = LArmBase
598
599 local RWeld2 = Instance.new("Weld")
600 RWeld2.Name = "RWeld"
601 RWeld2.Part0 = RArmBase
602 RWeld2.Part1 = Vars.RArm
603 RWeld2.Parent = RArmBase
604
605 local LLegWeld = Instance.new("Weld")
606 LLegWeld.Name = "LLegWeld"
607 LLegWeld.Part0 = Vars.Torso
608 LLegWeld.Part1 = nil
609 LLegWeld.C0 = CF(-0.5, -2, 0)
610 LLegWeld.Parent = Vars.Torso
611
612 local RLegWeld = Instance.new("Weld")
613 RLegWeld.Name = "RLegWeld"
614 RLegWeld.Part0 = Vars.Torso
615 RLegWeld.Part1 = nil
616 RLegWeld.C0 = CF(0.5, -2, 0)
617 RLegWeld.Parent = Vars.Torso
618
619 for _, Tab in pairs(Vars.gunParts) do
620 Tab.Obj.Anchored = false
621 local Weld = Instance.new("Weld")
622 Weld.Name = "mainWeld"
623 Weld.Part0 = Vars.Handle
624 Weld.Part1 = Tab.Obj
625 Weld.C0 = Tab.Obj.weldCF.Value
626 Weld.Parent = Vars.Handle
627 Tab.Weld = Weld
628 end
629
630 return gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, Vars.gunParts
631end
632
633----------------------------------------------------------------------
634--------------------[ TWEENJOINT HANDLING ]---------------------------
635----------------------------------------------------------------------
636
637local createTweenIndicator = script:WaitForChild("createTweenIndicator")
638function createTweenIndicator.OnServerInvoke(_, Joint, newCode)
639 local tweenIndicator = nil
640 if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
641 tweenIndicator = Instance.new("IntValue")
642 tweenIndicator.Name = "tweenCode"
643 tweenIndicator.Value = newCode
644 tweenIndicator.Parent = Joint
645 else
646 tweenIndicator = Joint.tweenCode
647 tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
648 end
649 return tweenIndicator
650end
651
652local lerpCF = script:WaitForChild("lerpCF")
653function lerpCF.OnServerInvoke(_, Joint, Prop, startCF, endCF, Alpha)
654 spawn(function()
655 Joint[Prop] = startCF:lerp(endCF, Alpha)
656 end)
657end
658
659local deleteTweenIndicator = script:WaitForChild("deleteTweenIndicator")
660function deleteTweenIndicator.OnServerInvoke(_, tweenIndicator, newCode)
661 if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
662 tweenIndicator:Destroy()
663 end
664end
665
666----------------------------------------------------------------------
667--------------------[ BULLET IMPACT HANDLING ]------------------------
668----------------------------------------------------------------------
669
670local createBulletImpact = script:WaitForChild("createBulletImpact")
671createBulletImpact.OnServerEvent:connect(function(_, H, P, N, D, humanoidFound, gunIgnore, S)
672 local surfaceCF = CF(P, P + N)
673 ----------------------------------------------------------------------------------
674 --Creating the bullet hole--------------------------------------------------------
675 ----------------------------------------------------------------------------------
676 if S.bulletHoles and (not humanoidFound) then
677 local Hole = Instance.new("Part")
678 Hole.Transparency = 1
679 Hole.Anchored = true
680 Hole.CanCollide = false
681 Hole.FormFactor = "Custom"
682 Hole.Size = V3(1, 1, 0.2)
683 Hole.TopSurface = 0
684 Hole.BottomSurface = 0
685 local Mesh = Instance.new("BlockMesh")
686 Mesh.Offset = V3(0, 0, -0.05)
687 Mesh.Scale = V3(S.holeSettings.Size, S.holeSettings.Size, 0)
688 Mesh.Parent = Hole
689 local Decal = Instance.new("Decal")
690 Decal.Face = Enum.NormalId.Front
691 Decal.Texture = S.holeSettings.Texture
692 Decal.Parent = Hole
693 Hole.Parent = gunIgnore
694 Hole.CFrame = surfaceCF
695 if (not H.Anchored) then
696 local Weld = Instance.new("Weld", Hole)
697 Weld.Part0 = H
698 Weld.Part1 = Hole
699 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
700 Hole.Anchored = false
701 end
702 delay(S.holeSettings.visibleTime, function()
703 if S.holeSettings.disappearTime > 0 then
704 local t0 = tick()
705 while true do
706 local Alpha = math.min((tick() - t0) / S.holeSettings.disappearTime, 1)
707 Decal.Transparency = numLerp(0, 1, Alpha)
708 if Alpha == 1 then break end
709 wait()
710 end
711 Hole:Destroy()
712 else
713 Hole:Destroy()
714 end
715 end)
716 end
717 ----------------------------------------------------------------------------------
718 --Creating the spark effect-------------------------------------------------------
719 ----------------------------------------------------------------------------------
720 if S.bulletSparks and (not humanoidFound) and inList(H.Material, S.sparkSettings.Materials) then
721 local Sparks = Instance.new("Part")
722 Sparks.Transparency = 1
723 Sparks.Anchored = true
724 Sparks.CanCollide = false
725 Sparks.FormFactor = "Custom"
726 Sparks.Size = V3(1, 1, 1)
727 Sparks.TopSurface = 0
728 Sparks.BottomSurface = 0
729
730 local Particles = nil
731 if S.customSparks then
732 Particles = getObject(game.ServerStorage, "ParticleEmitter", "bulletSpark"):Clone()
733 else
734 Particles = Instance.new("ParticleEmitter")
735 Particles.Color = ColorSequence.new(S.sparkSettings.Color.Start, S.sparkSettings.Color.End)
736 Particles.LightEmission = 1
737 Particles.Size = NumberSequence.new(
738 {
739 NumberSequenceKeypoint.new(0, S.sparkSettings.Size, 0.25);
740 NumberSequenceKeypoint.new(1, 0);
741 }
742 )
743 Particles.Texture = S.sparkSettings.Texture
744 Particles.Transparency = NumberSequence.new(0)
745 Particles.Acceleration = V3(0, -196.2, 0)
746 Particles.EmissionDirection = Enum.NormalId.Front
747 Particles.Lifetime = NumberRange.new(S.sparkSettings.Lifetime - 0.05, S.sparkSettings.Lifetime + 0.05)
748 Particles.Rate = S.sparkSettings.Rate
749 Particles.Rotation = NumberRange.new(0, 360)
750 Particles.Speed = NumberRange.new(S.sparkSettings.Speed - 5, S.sparkSettings.Speed + 5)
751 Particles.VelocitySpread = S.sparkSettings.Spread
752 end
753 Particles.Parent = Sparks
754
755 Sparks.Parent = gunIgnore
756 Sparks.CFrame = surfaceCF
757 if (not H.Anchored) then
758 local Weld = Instance.new("Weld", Sparks)
759 Weld.Part0 = H
760 Weld.Part1 = Sparks
761 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
762 Sparks.Anchored = false
763 end
764 delay(0.1, function()
765 Particles.Enabled = false
766 wait(Particles.Lifetime.Max)
767 Sparks:Destroy()
768 end)
769 end
770 ----------------------------------------------------------------------------------
771 --Creating the smoke effect-------------------------------------------------------
772 ----------------------------------------------------------------------------------
773 if S.bulletSmoke and (not humanoidFound) then
774 local Smoke = Instance.new("Part")
775 Smoke.Transparency = 1
776 Smoke.Anchored = true
777 Smoke.CanCollide = false
778 Smoke.FormFactor = "Custom"
779 Smoke.Size = V3(1, 1, 1)
780 Smoke.TopSurface = 0
781 Smoke.BottomSurface = 0
782
783 local Particles = Instance.new("ParticleEmitter")
784 Particles.Color = ColorSequence.new(S.smokeSettings.objColor and H.Color or S.smokeSettings.Color)
785 Particles.LightEmission = 0
786 Particles.Size = NumberSequence.new(
787 {
788 NumberSequenceKeypoint.new(0, S.smokeSettings.Size.Start);
789 NumberSequenceKeypoint.new(1, S.smokeSettings.Size.End);
790 }
791 )
792 Particles.Texture = S.smokeSettings.Texture
793 Particles.Transparency = NumberSequence.new(
794 {
795 NumberSequenceKeypoint.new(0, S.smokeSettings.startTransparency);
796 NumberSequenceKeypoint.new(0.5, 0.75 * S.smokeSettings.startTransparency + 0.25);
797 NumberSequenceKeypoint.new(1, 1);
798 }
799 )
800 Particles.Acceleration = V3(0, -196.2, 0)
801 Particles.EmissionDirection = Enum.NormalId.Front
802 Particles.Lifetime = NumberRange.new(S.smokeSettings.Lifetime - 0.05, S.smokeSettings.Lifetime + 0.05)
803 Particles.Rate = S.smokeSettings.Rate
804 Particles.Rotation = NumberRange.new(0, 360)
805 Particles.RotSpeed = NumberRange.new(10)
806 Particles.Speed = NumberRange.new(S.smokeSettings.Speed - 5, S.smokeSettings.Speed + 5)
807 Particles.VelocitySpread = S.smokeSettings.Spread
808 Particles.Parent = Smoke
809
810 Smoke.Parent = gunIgnore
811 Smoke.CFrame = surfaceCF
812 if (not H.Anchored) then
813 local Weld = Instance.new("Weld", Smoke)
814 Weld.Part0 = H
815 Weld.Part1 = Smoke
816 Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
817 Smoke.Anchored = false
818 end
819 delay(0.1, function()
820 Particles.Enabled = false
821 wait(S.smokeSettings.Lifetime + 0.05)
822 Smoke:Destroy()
823 end)
824 end
825end)
826
827----------------------------------------------------------------------
828--------------------[ SHOCKWAVE HANDLING ]----------------------------
829----------------------------------------------------------------------
830
831local createShockwave = script:WaitForChild("createShockwave")
832createShockwave.OnServerEvent:connect(function(_, Center, Radius, gunIgnore, S)
833 local Shockwave = Instance.new("Part")
834 Shockwave.BrickColor = S.shockwaveSettings.Color
835 Shockwave.Material = Enum.Material.SmoothPlastic
836 Shockwave.Name = "Shockwave"
837 Shockwave.Anchored = true
838 Shockwave.CanCollide = false
839 Shockwave.FormFactor = Enum.FormFactor.Symmetric
840 Shockwave.Size = V3(1, 1, 1)
841 Shockwave.BottomSurface = Enum.SurfaceType.Smooth
842 Shockwave.TopSurface = Enum.SurfaceType.Smooth
843 local Mesh = Instance.new("SpecialMesh")
844 Mesh.MeshType = Enum.MeshType.Sphere
845 Mesh.Scale = V3()
846 Mesh.Parent = Shockwave
847 Shockwave.Parent = gunIgnore
848 Shockwave.CFrame = CF(Center)
849 spawn(function()
850 local t0 = tick()
851 while true do
852 local Alpha = math.min((tick() - t0) / S.shockwaveSettings.Duration, 1)
853 local Scale = 2 * Radius * Alpha
854 Mesh.Scale = V3(Scale, Scale, Scale)
855 Shockwave.Transparency = Alpha
856 if Alpha == 1 then break end
857 wait()
858 end
859 Shockwave:Destroy()
860 end)
861end)
862
863----------------------------------------------------------------------
864--------------------[ BLOOD HANDLING ]--------------------------------
865----------------------------------------------------------------------
866
867local createBlood = script:WaitForChild("createBlood")
868createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
869 local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
870 local Blood = Instance.new("Part")
871 Blood.Transparency = 1
872 Blood.Anchored = true
873 Blood.CanCollide = false
874 Blood.FormFactor = "Custom"
875 Blood.Size = V3(0.2, 1, 0.2)
876 Blood.TopSurface = 0
877 Blood.BottomSurface = 0
878
879 local Particles = Instance.new("ParticleEmitter")
880 Particles.Color = ColorSequence.new(S.bloodSettings.Color)
881 Particles.LightEmission = 0
882 Particles.Size = NumberSequence.new(S.bloodSettings.Size)
883 Particles.Texture = S.bloodSettings.Texture
884 Particles.Transparency = NumberSequence.new(
885 {
886 NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency);
887 NumberSequenceKeypoint.new(1, 1);
888 }
889 )
890 Particles.EmissionDirection = Enum.NormalId.Top
891 Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
892 Particles.Rate = S.bloodSettings.Rate
893 Particles.Rotation = NumberRange.new(0, 90)
894 Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
895 Particles.VelocitySpread = S.bloodSettings.Spread
896 Particles.Parent = Blood
897
898 Blood.Parent = gunIgnore
899 Blood.CFrame = bloodCF
900 if (not H.Anchored) then
901 local Weld = Instance.new("Weld", Blood)
902 Weld.Part0 = H
903 Weld.Part1 = Blood
904 Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
905 Blood.Anchored = false
906 end
907 delay(0.15, function()
908 Particles.Enabled = false
909 wait(S.bloodSettings.Lifetime + 0.05)
910 Blood:Destroy()
911 end)
912end)
913
914----------------------------------------------------------------------
915--------------------[ TRAIL HANDLING ]--------------------------------
916----------------------------------------------------------------------
917
918local createTrail = script:WaitForChild("createTrail")
919createTrail.OnServerEvent:connect(function(_, Origin, P, gunIgnore, S)
920 local Trail = Instance.new("Part")
921 Trail.BrickColor = S.trailSettings.Color
922 Trail.Transparency = S.trailSettings.Transparency
923 Trail.Anchored = true
924 Trail.CanCollide = false
925 Trail.Size = V3(1, 1, 1)
926 local Mesh = Instance.new("CylinderMesh")
927 Mesh.Offset = V3(0, -(P - Origin).magnitude / 2, 0)
928 Mesh.Scale = V3(S.trailSettings.Thickness, (P - Origin).magnitude, S.trailSettings.Thickness)
929 Mesh.Parent = Trail
930 Trail.Parent = gunIgnore
931 Trail.CFrame = CF(Origin, P) * CFANG(RAD(90), 0, 0)
932 delay(S.trailSettings.visibleTime, function()
933 if S.trailSettings.disappearTime > 0 then
934 local t0 = tick()
935 while true do
936 local Alpha = math.min((tick() - t0) / S.trailSettings.disappearTime, 1)
937 Trail.Transparency = numLerp(S.trailSettings.Transparency, 1, Alpha)
938 if Alpha == 1 then break end
939 wait()
940 end
941 Trail:Destroy()
942 else
943 Trail:Destroy()
944 end
945 end)
946end)
947end))
948ObjectValue21.Name = "Plyr"
949ObjectValue21.Parent = Script20
950RemoteFunction22.Name = "getWeldCF"
951RemoteFunction22.Parent = Script20
952RemoteFunction23.Name = "gunSetup"
953RemoteFunction23.Parent = Script20
954RemoteFunction24.Name = "tweenJoint"
955RemoteFunction24.Parent = Script20
956RemoteEvent25.Name = "onRenderStep"
957RemoteEvent25.Parent = Script20
958RemoteFunction26.Name = "createTweenIndicator"
959RemoteFunction26.Parent = Script20
960RemoteFunction27.Name = "deleteTweenIndicator"
961RemoteFunction27.Parent = Script20
962RemoteFunction28.Name = "lerpCF"
963RemoteFunction28.Parent = Script20
964LocalScript29.Name = "resetCam"
965LocalScript29.Parent = Script20
966table.insert(cors,sandbox(LocalScript29,function()
967repeat wait() until game.Players.LocalPlayer.Character
968
969local Player = game.Players.LocalPlayer
970local Char = Player.Character
971local Humanoid = Char:WaitForChild("Humanoid")
972
973local Cam = game.Workspace.CurrentCamera
974local UIS = game:GetService("UserInputService")
975
976local ignoreCode = script:WaitForChild("ignoreCode")
977repeat wait() until ignoreCode.Value ~= 0
978local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
979local gunIgnore = ignoreModel:FindFirstChild("gunIgnore_"..Player.Name)
980
981Cam.FieldOfView = 70
982Cam.CameraType = Enum.CameraType.Custom
983Cam:ClearAllChildren()
984
985UIS.MouseBehavior = Enum.MouseBehavior.Default
986UIS.MouseIconEnabled = true
987
988Player.CameraMode = Enum.CameraMode.Classic
989
990Humanoid.WalkSpeed = 16
991Humanoid.AutoRotate = true
992
993if gunIgnore then gunIgnore:Destroy() end
994end))
995IntValue30.Name = "ignoreCode"
996IntValue30.Parent = LocalScript29
997RemoteEvent31.Name = "createBulletImpact"
998RemoteEvent31.Parent = Script20
999RemoteEvent32.Name = "createShockwave"
1000RemoteEvent32.Parent = Script20
1001RemoteEvent33.Name = "createBlood"
1002RemoteEvent33.Parent = Script20
1003RemoteEvent34.Name = "createTrail"
1004RemoteEvent34.Parent = Script20
1005LocalScript35.Name = "clientMain"
1006LocalScript35.Parent = Tool0
1007table.insert(cors,sandbox(LocalScript35,function()
1008--[[
1009Kit By TurboFusion
1010Remake By MuYhEt & Xander521
1011--]]
1012--------------------------------------------------------------------------------------
1013--------------------[ CHARACTER LOADING ]---------------------------------------------
1014--------------------------------------------------------------------------------------
1015print("Kit By TurboFusion // Remake By MuYhEt & Xander521")
1016
1017repeat wait() until game.Players.LocalPlayer.Character
1018repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
1019wait(1 / 20)
1020
1021--------------------------------------------------------------------------------------
1022--------------------[ IGNORE MODEL ]--------------------------------------------------
1023--------------------------------------------------------------------------------------
1024
1025local ignoreCode = script:WaitForChild("ignoreCode")
1026
1027repeat wait() until ignoreCode.Value ~= 0
1028
1029local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
1030
1031local grenadeFolder = ignoreModel:WaitForChild("grenadeFolder")
1032
1033--------------------------------------------------------------------------------------
1034--------------------[ CONSTANTS ]-----------------------------------------------------
1035--------------------------------------------------------------------------------------
1036
1037local Gun = script.Parent
1038local serverMain = Gun:WaitForChild("serverMain")
1039local Handle = Gun:WaitForChild("Handle")
1040local AimPart = Gun:WaitForChild("SightMark")
1041local Main = Gun:WaitForChild("Flame")
1042
1043local Ammo = Gun:WaitForChild("Ammo")
1044local ClipSize = Gun:WaitForChild("ClipSize")
1045local StoredAmmo = Gun:WaitForChild("StoredAmmo")
1046
1047local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
1048local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
1049local getWeldCF = serverMain:WaitForChild("getWeldCF")
1050local gunSetup = serverMain:WaitForChild("gunSetup")
1051local lerpCF = serverMain:WaitForChild("lerpCF")
1052local createBlood = serverMain:WaitForChild("createBlood")
1053local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
1054local createShockwave = serverMain:WaitForChild("createShockwave")
1055local createTrail = serverMain:WaitForChild("createTrail")
1056
1057local Particle = require(script:WaitForChild("Particle"))
1058local Spring = require(script:WaitForChild("Spring"))
1059local Anims = require(Gun:WaitForChild("ANIMATIONS"))
1060local Plugins = require(Gun:WaitForChild("PLUGINS"))
1061local S = require(Gun:WaitForChild("SETTINGS"))
1062
1063local Player = game.Players.LocalPlayer
1064local Char = Player.Character
1065local Humanoid = Char:WaitForChild("Humanoid")
1066local Torso = Char:WaitForChild("Torso")
1067local Head = Char:WaitForChild("Head")
1068local HRP = Char:WaitForChild("HumanoidRootPart")
1069local Root = HRP:WaitForChild("RootJoint")
1070
1071local Neck = Torso:WaitForChild("Neck")
1072
1073local LArm = Char:WaitForChild("Left Arm")
1074local RArm = Char:WaitForChild("Right Arm")
1075local LLeg = Char:WaitForChild("Left Leg")
1076local RLeg = Char:WaitForChild("Right Leg")
1077
1078local M2 = Player:GetMouse()
1079
1080local mainGUI = script:WaitForChild("mainGUI")
1081
1082local crossHair = mainGUI:WaitForChild("crossHair")
1083local HUD = mainGUI:WaitForChild("HUD")
1084local Scope = mainGUI:WaitForChild("Scope")
1085local fireSelect = mainGUI:WaitForChild("fireSelect")
1086local hitMarker = mainGUI:WaitForChild("hitMarker")
1087local Sens = mainGUI:WaitForChild("Sens")
1088
1089local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
1090local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
1091local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
1092local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")
1093
1094local Controls = HUD:WaitForChild("Controls")
1095
1096local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")
1097
1098local scopeMain = Scope:WaitForChild("Main")
1099local scopeSteady = Scope:WaitForChild("Steady")
1100
1101local fireModes = fireSelect:WaitForChild("Modes")
1102
1103local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
1104local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
1105local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
1106
1107local DS = game:GetService("Debris")
1108local CP = game:GetService("ContentProvider")
1109local RS = game:GetService("RunService")
1110local UIS = game:GetService("UserInputService")
1111
1112local Cam = game.Workspace.CurrentCamera
1113
1114local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
1115local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
1116local VEC2, V3 = Vector2.new, Vector3.new
1117local CF, CFANG = CFrame.new, CFrame.Angles
1118local INSERT = table.insert
1119
1120local maxStamina = S.sprintTime * 60
1121local maxSteadyTime = S.scopeSettings.steadyTime * 60
1122
1123local LethalIcons = {
1124 "http://www.roblox.com/asset/?id=194849880";
1125 "http://www.roblox.com/asset/?id=195727791";
1126 "http://www.roblox.com/asset/?id=195728137";
1127 "http://www.roblox.com/asset/?id=218151830";
1128}
1129
1130local TacticalIcons = {
1131 "http://www.roblox.com/asset/?id=195728473";
1132 "http://www.roblox.com/asset/?id=195728693";
1133}
1134
1135local ASCII = {
1136 071; 117; 110; 032;
1137 075; 105; 116; 032;
1138 115; 099; 114; 105;
1139 112; 116; 101; 100;
1140 032; 098; 121; 032;
1141 084; 117; 114; 098;
1142 111; 070; 117; 115;
1143 105; 111; 110; 000;
1144}
1145
1146local Ignore = {
1147 Char;
1148 ignoreModel;
1149}
1150
1151local Shoulders = {
1152 Right = Torso:WaitForChild("Right Shoulder");
1153 Left = Torso:WaitForChild("Left Shoulder")
1154}
1155
1156local armC0 = {
1157 CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
1158 CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
1159}
1160
1161local legC0 = {
1162 Stand = {
1163 CF(-0.5, -2, 0);
1164 CF(0.5, -2, 0);
1165 };
1166 Crouch = {
1167 CF(-0.5, -1.5, 0.5) * CFANG(-RAD(90), 0, 0);
1168 CF(0.5, -1, -0.75);
1169 };
1170 Prone = {
1171 CF(-0.5, -2, 0);
1172 CF(0.5, -2, 0);
1173 };
1174}
1175
1176local Sine = function(X)
1177 return SIN(RAD(X))
1178end
1179
1180local Linear = function(X)
1181 return (X / 90)
1182end
1183
1184--------------------------------------------------------------------------------------
1185--------------------[ VARIABLES ]-----------------------------------------------------
1186--------------------------------------------------------------------------------------
1187
1188local Selected = false
1189
1190local playerMass = 0
1191
1192local Forward = false
1193local Backward = false
1194
1195local Idling = false
1196local Walking = false
1197local Running = false
1198
1199local crawlCamRot = 0
1200local crawlAlpha = 0
1201local idleAlpha = 1
1202local walkAlpha = 0
1203local isCrawling = false
1204local isIdling = false
1205local isWalking = false
1206local isRunning = false
1207
1208local Aimed = false
1209local Aiming = false
1210local aimAlpha = 0
1211local headOffset = VEC2(COS(RAD(90) - S.aimSettings.headTilt) * 0.5, 1 + SIN(RAD(90) - S.aimSettings.headTilt) * 0.5)
1212
1213local Reloading = false
1214local breakReload = false
1215local magVisible = true
1216local newMag = false
1217
1218local Knifing = false
1219
1220local MB1Down = false
1221local Firing = false
1222local canFire = true
1223local fireFunction = nil
1224local firstShot = false
1225local shotCount = 0
1226local lastSideRecoil = {0, 0}
1227local recoilAnim = {
1228 Pos = V3();
1229 Rot = V3();
1230 Code = nil;
1231}
1232
1233local numModes = 0
1234local rawFireMode = 1
1235local canSelectFire = true
1236local guiAngOffset = 0
1237local Modes = {}
1238
1239local onGround = true
1240local startFallHeight = 0
1241local jumpAnim = {
1242 Pos = 0;
1243 Rot = 0;
1244 Code = 0;
1245}
1246
1247local runReady = true
1248local runKeyPressed = false
1249local chargingStamina = false
1250
1251local AimingIn = false
1252local AimingOut = false
1253
1254local Stamina = S.sprintTime * 60
1255local currentSteadyTime = S.scopeSettings.steadyTime * 60
1256
1257local camSteady = false
1258local takingBreath = false
1259local steadyKeyPressed = false
1260
1261local Grip = nil
1262local aimedGripCF = nil
1263
1264local spreadZoom = "unAimed"
1265local spreadStance = "Stand"
1266local spreadMotion = "Idling"
1267local baseSpread = S.spreadSettings.unAimed.Stand.Idling
1268local currentSpread = 0
1269local loweringSpread = false
1270
1271local mouseSensitivity = S.sensitivitySettings.Default
1272local aimSensitivity = S.sensitivitySettings.Aim
1273local lastSensUpdate = 0
1274
1275local ammoInClip = 0
1276
1277local Stance = 0
1278local stanceSway = 1
1279local camSway = 1
1280
1281local camAng = VEC2()
1282
1283local armTilt = 0
1284local moveAng = 0
1285local animCode = 0
1286
1287local desiredXOffset = 0
1288local desiredYOffset = 0
1289local currentXOffset = 0
1290local currentYOffset = 0
1291local aimHeadOffset = 0
1292local recoilAnimMultiplier = 1
1293local jumpAnimMultiplier = 1
1294local translationDivisor = 7
1295local rotationMultiplier = S.momentumSettings.Amplitude.unAimed
1296local armTiltMultiplier = 1
1297
1298local equipAnimPlaying = false
1299
1300local crossOffset = 0
1301
1302local camOffsets = {
1303 guiScope = {
1304 Rot = V3();
1305 };
1306 Reload = {
1307 Rot = V3();
1308 Code = nil;
1309 };
1310 Recoil = {
1311 Rot = V3();
1312 Code = nil;
1313 };
1314}
1315
1316local Anim = {
1317 Pos = V3();
1318 Rot = V3();
1319 Ang = 0;
1320 Code = 0;
1321}
1322
1323local lastBeat = 0
1324
1325local gunParts = {}
1326
1327local Connections = {}
1328
1329local Keys = {}
1330
1331--------------------------------------------------------------------------------------
1332--------------------[ PRE-LOADING ]---------------------------------------------------
1333--------------------------------------------------------------------------------------
1334
1335CP:Preload(S.explosionSettings.soundId)
1336CP:Preload(S.holeSettings.Texture)
1337CP:Preload(S.sparkSettings.Texture)
1338CP:Preload(S.smokeSettings.Texture)
1339CP:Preload(S.bloodSettings.Texture)
1340CP:Preload("http://www.roblox.com/asset/?id=126877530") --The dark green arrow in the select fire gui
1341CP:Preload("http://www.roblox.com/asset/?id=55754953") --The circle in the select fire gui
1342
1343--------------------------------------------------------------------------------------
1344--------------------[ GUN SETUP ]-----------------------------------------------------
1345--------------------------------------------------------------------------------------
1346
1347serverMain:WaitForChild("Plyr").Value = Player
1348
1349local gunMomentum = Spring.new(V3())
1350gunMomentum.s = S.momentumSettings.Speed
1351gunMomentum.d = S.momentumSettings.Damper
1352
1353local gunRecoilSpring = Spring.new(V3())
1354gunRecoilSpring.s = S.recoilSettings.springSpeed
1355gunRecoilSpring.d = S.recoilSettings.springDamper
1356
1357local camRecoilSpring = Spring.new(V3())
1358camRecoilSpring.s = 35
1359camRecoilSpring.d = 0.5
1360
1361local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
1362crossSpring.s = 20
1363crossSpring.d = 0.75
1364
1365--[[local function getModelMass(P)
1366 for _, v in pairs(P:GetChildren()) do
1367 if v:IsA("BasePart") then
1368 playerMass = playerMass + v:GetMass()
1369 end
1370 getModelMass(v)
1371 end
1372end
1373getModelMass(Char)
1374
1375Char.DescendantAdded:connect(function(Descendant)
1376 if Descendant:IsA("BasePart") then
1377 playerMass = playerMass + Descendant:GetMass()
1378 end
1379end)
1380Char.DescendantRemoving:connect(function(Descendant)
1381 if Descendant:IsA("BasePart") then
1382 playerMass = playerMass - Descendant:GetMass()
1383 end
1384end)]]
1385
1386--------------------------------------------------------------------------------------
1387--------------------[ WELD CFRAMES ]--------------------------------------------------
1388--------------------------------------------------------------------------------------
1389
1390spawn(function()
1391 --[[for _, v in pairs(Gun:GetChildren()) do
1392 if v:IsA("BasePart") and v ~= Handle then
1393 if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
1394 if (not v:FindFirstChild("weldCF")) then
1395 local weldCF = Instance.new("CFrameValue")
1396 weldCF.Name = "weldCF"
1397 weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
1398 weldCF.Parent = v
1399 INSERT(gunParts, {Obj = v, Weld = nil})
1400 end
1401 if string.sub(v.Name, 1, 3) == "Mag" then
1402 if (not v:FindFirstChild("magTrans")) then
1403 local magTrans = Instance.new("NumberValue")
1404 magTrans.Name = "magTrans"
1405 magTrans.Value = v.Transparency
1406 magTrans.Parent = v
1407 end
1408 end
1409 v.Anchored = false
1410 end
1411 end
1412 Handle.Anchored = false]]
1413 for _, v in pairs(Gun:GetChildren()) do
1414 if v:FindFirstChild("weldCF") then
1415 INSERT(gunParts, {Obj = v, Weld = nil})
1416 v.Anchored = false
1417 end
1418 end
1419end)
1420
1421--------------------------------------------------------------------------------------
1422--------------------[ MAIN PROGRAM ]--------------------------------------------------
1423--------------------------------------------------------------------------------------
1424
1425--------------------[ ARM CREATION FUNCTION ]-----------------------------------------
1426
1427function createArms()
1428 local Arms = {}
1429 for i = 0, 1 do
1430 local armModel = Instance.new("Model")
1431 armModel.Name = "armModel"
1432
1433 local Arm = Instance.new("Part")
1434 Arm.BrickColor = (S.fakeArmSettings.realBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.fakeArmSettings.Color)
1435 Arm.Transparency = S.fakeArmSettings.Transparency
1436 Arm.Name = "Arm"
1437 Arm.CanCollide = false
1438 Arm.Size = V3(0.598, 2, 0.598)
1439 Arm.Parent = armModel
1440 local armMesh = Instance.new("SpecialMesh")
1441 armMesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1442 armMesh.MeshType = Enum.MeshType.FileMesh
1443 armMesh.Scale = V3(0.598, 1, 0.598)
1444 armMesh.Parent = Arm
1445
1446 local Glove1 = Instance.new("Part")
1447 Glove1.BrickColor = BrickColor.new("Black")
1448 Glove1.Name = "Glove1"
1449 Glove1.CanCollide = false
1450 Glove1.Size = V3(0.598, 2, 0.598)
1451 Glove1.Parent = armModel
1452 local glove1Mesh = Instance.new("SpecialMesh")
1453 glove1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1454 glove1Mesh.Offset = V3(0, -0.5, 0)
1455 glove1Mesh.Scale = V3(0.658, 0.205, 0.658)
1456 glove1Mesh.Parent = Glove1
1457 local glove1Weld = Instance.new("Weld")
1458 glove1Weld.Part0 = Arm
1459 glove1Weld.Part1 = Glove1
1460 glove1Weld.Parent = Arm
1461
1462 local Glove2 = Instance.new("Part")
1463 Glove2.BrickColor = BrickColor.new("Black")
1464 Glove2.Name = "Glove2"
1465 Glove2.CanCollide = false
1466 Glove2.Size = V3(0.598, 2, 0.598)
1467 Glove2.Parent = armModel
1468 local glove2Mesh = Instance.new("SpecialMesh")
1469 glove2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1470 glove2Mesh.Offset = V3(0, -0.435, 0)
1471 glove2Mesh.Scale = V3(0.69, 0.105, 0.69)
1472 glove2Mesh.Parent = Glove2
1473 local glove2Weld = Instance.new("Weld")
1474 glove2Weld.Part0 = Arm
1475 glove2Weld.Part1 = Glove2
1476 glove2Weld.Parent = Arm
1477
1478 local Glove3 = Instance.new("Part")
1479 Glove3.BrickColor = BrickColor.new("Black")
1480 Glove3.Name = "Glove3"
1481 Glove3.CanCollide = false
1482 Glove3.Size = V3(0.598, 2, 0.598)
1483 Glove3.Parent = armModel
1484 local glove3Mesh = Instance.new("SpecialMesh")
1485 glove3Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1486 glove3Mesh.Offset = V3(0.18 * ((i * 2) - 1), -0.7, 0)
1487 glove3Mesh.Scale = V3(0.299, 0.305, 0.657)
1488 glove3Mesh.Parent = Glove3
1489 local glove3Weld = Instance.new("Weld")
1490 glove3Weld.Part0 = Arm
1491 glove3Weld.Part1 = Glove3
1492 glove3Weld.Parent = Arm
1493
1494 local Sleeve1 = Instance.new("Part")
1495 Sleeve1.BrickColor = BrickColor.new("Sand green")
1496 Sleeve1.Name = "Sleeve1"
1497 Sleeve1.CanCollide = false
1498 Sleeve1.Size = V3(0.598, 2, 0.598)
1499 Sleeve1.Parent = armModel
1500 local sleeve1Mesh = Instance.new("SpecialMesh")
1501 sleeve1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1502 sleeve1Mesh.Offset = V3(0, 0.75, 0)
1503 sleeve1Mesh.Scale = V3(0.656, 0.3, 0.656)
1504 sleeve1Mesh.Parent = Sleeve1
1505 local sleeve1Weld = Instance.new("Weld")
1506 sleeve1Weld.Part0 = Arm
1507 sleeve1Weld.Part1 = Sleeve1
1508 sleeve1Weld.Parent = Arm
1509
1510 local Sleeve2 = Instance.new("Part")
1511 Sleeve2.BrickColor = BrickColor.new("Sand green")
1512 Sleeve2.Name = "Sleeve2"
1513 Sleeve2.CanCollide = false
1514 Sleeve2.Size = V3(0.598, 2, 0.598)
1515 Sleeve2.Parent = armModel
1516 local sleeve2Mesh = Instance.new("SpecialMesh")
1517 sleeve2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
1518 sleeve2Mesh.Offset = V3(0, 0.55, 0)
1519 sleeve2Mesh.Scale = V3(0.75, 0.1, 0.75)
1520 sleeve2Mesh.Parent = Sleeve2
1521 local sleeve2Weld = Instance.new("Weld")
1522 sleeve2Weld.Part0 = Arm
1523 sleeve2Weld.Part1 = Sleeve2
1524 sleeve2Weld.Parent = Arm
1525
1526 table.insert(Arms, {Model = armModel, armPart = Arm})
1527 end
1528 return Arms
1529end
1530
1531--------------------[ MATH FUNCTIONS ]------------------------------------------------
1532
1533function Map(Val, fromLow, fromHigh, toLow, toHigh)
1534 return (Val - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow
1535end
1536
1537function numLerp(A, B, Alpha)
1538 return A + (B - A) * Alpha
1539end
1540
1541function RAND(Min, Max, Accuracy)
1542 return numLerp(Min, Max, math.random())
1543 --[[local Inverse = 1 / (Accuracy or 1)
1544 return (math.random(Min * Inverse, Max * Inverse) / Inverse)]]
1545end
1546
1547function Round(Num, toNearest)
1548 return math.floor(Num / toNearest + 0.5) * toNearest
1549end
1550
1551function getNearestPoint(A, B, Origin)
1552 local A2 = (A - Origin).magnitude
1553 local B2 = (B - Origin).magnitude
1554 return (math.min(A2, B2) == A2 and A or B)
1555end
1556
1557--------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
1558
1559function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
1560 spawn(function()
1561 local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
1562 local tweenIndicator = nil
1563 if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
1564 tweenIndicator = Instance.new("IntValue")
1565 tweenIndicator.Name = "tweenCode"
1566 tweenIndicator.Value = newCode
1567 tweenIndicator.Parent = Joint
1568 else
1569 tweenIndicator = Joint.tweenCode
1570 tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
1571 end
1572 --local tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
1573 if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
1574 if newC0 then Joint.C0 = newC0 end
1575 if newC1 then Joint.C1 = newC1 end
1576 else
1577 local startC0 = Joint.C0
1578 local startC1 = Joint.C1
1579 local t0 = tick()
1580 while true do
1581 RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
1582 local X = math.min((tick() - t0) / Duration, 1) * 90
1583 if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
1584 if (not Selected) then break end --This stops the tween if the tool is deselected
1585 if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
1586 if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
1587 --if newC0 then lerpCF:InvokeServer(Joint, "C0", startC0, newC0, Alpha(X)) end
1588 --if newC1 then lerpCF:InvokeServer(Joint, "C1", startC1, newC1, Alpha(X)) end
1589 if X == 90 then break end
1590 end
1591 end
1592 if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
1593 tweenIndicator:Destroy()
1594 end
1595 --deleteTweenIndicator:InvokeServer(tweenIndicator, newCode)
1596 end)
1597end
1598
1599function tweenCam(Key, newRot, Alpha, Duration)
1600 spawn(function()
1601 local newCode = math.random(-1e9, 1e9)
1602 camOffsets[Key].Code = newCode
1603
1604 local Increment = 1.5 / Duration
1605 local prevRot = camOffsets[Key].Rot
1606 local X = 0
1607 while true do
1608 RS.RenderStepped:wait()
1609 local newX = X + Increment
1610 X = (newX > 90 and 90 or newX)
1611 if camOffsets[Key].Code ~= newCode then break end
1612 if (not Selected) then break end
1613
1614 camOffsets[Key].Rot = prevRot:lerp(newRot, Alpha(X))
1615
1616 if X == 90 then break end
1617 end
1618
1619 if camOffsets[Key].Code == newCode then
1620 camOffsets[Key].Code = nil
1621 end
1622 end)
1623end
1624
1625function tweenRecoil(newPos, newRot, Alpha, Duration)
1626 spawn(function()
1627 local newCode = math.random(-1e9, 1e9)
1628 recoilAnim.Code = newCode
1629
1630 local Increment = 1.5 / Duration
1631 local prevPos = recoilAnim.Pos
1632 local prevRot = recoilAnim.Rot
1633 local X = 0
1634 while true do
1635 RS.RenderStepped:wait()
1636 local newX = X + Increment
1637 X = (newX > 90 and 90 or newX)
1638 if recoilAnim.Code ~= newCode then break end
1639 if (not Selected) then break end
1640
1641 recoilAnim.Pos = prevPos:lerp(newPos, Alpha(X))
1642 recoilAnim.Rot = prevRot:lerp(newRot, Alpha(X))
1643
1644 if X == 90 then break end
1645 end
1646
1647 if recoilAnim.Code == newCode then
1648 recoilAnim.Code = nil
1649 end
1650 end)
1651end
1652
1653--------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------
1654
1655local function updateClipAmmo()
1656 clipAmmoGUI.Text = Ammo.Value
1657 clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
1658end
1659
1660local function updateStoredAmmo()
1661 storedAmmoGUI.Text = StoredAmmo.Value
1662 storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
1663end
1664
1665local function updateHealth()
1666 HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
1667 HUD.Health.Num.TextColor3 = (
1668 (Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
1669 (Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
1670 (Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
1671 )
1672end
1673
1674local function updateModeLabels(prevState, newState, X)
1675 for Num, Mode in pairs(fireModes:GetChildren()) do
1676 local guiAngOffset2 = guiAngOffset + 90
1677 local Ang = numLerp(
1678 (guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
1679 (guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
1680 Sine(X)
1681 ) + guiAngOffset
1682 local XPos = COS(RAD(Ang))
1683 local YPos = SIN(RAD(Ang))
1684 Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
1685
1686 local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
1687 Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
1688
1689 local Scale = (R * 10) + 50
1690 Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
1691 Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
1692 end
1693end
1694
1695--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
1696
1697function convertKey(Key)
1698 if Key == string.char(8) then
1699 return "BKSPCE"
1700 elseif Key == string.char(9) then
1701 return "TAB"
1702 elseif Key == string.char(13) then
1703 return "ENTER"
1704 elseif Key == string.char(17) then
1705 return "UP"
1706 elseif Key == string.char(18) then
1707 return "DOWN"
1708 elseif Key == string.char(19) then
1709 return "RIGHT"
1710 elseif Key == string.char(20) then
1711 return "LEFT"
1712 elseif Key == string.char(22) then
1713 return "HOME"
1714 elseif Key == string.char(23) then
1715 return "END"
1716 elseif Key == string.char(27) then
1717 return "F2"
1718 elseif Key == string.char(29) then
1719 return "F4"
1720 elseif Key == string.char(30) then
1721 return "F5"
1722 elseif Key == string.char(32) or Key == " " then
1723 return "F7"
1724 elseif Key == string.char(33) or Key == "!" then
1725 return "F8"
1726 elseif Key == string.char(34) or Key == '"' then
1727 return "F9"
1728 elseif Key == string.char(35) or Key == "#" then
1729 return "F10"
1730 elseif Key == string.char(37) or Key == "%" then
1731 return "F12"
1732 elseif Key == string.char(47) or Key == "/" then
1733 return "R-SHIFT"
1734 elseif Key == string.char(48) or Key == "0" then
1735 return "L-SHIFT"
1736 elseif Key == string.char(49) or Key == "1" then
1737 return "R-CTRL"
1738 elseif Key == string.char(50) or Key == "2" then
1739 return "L-CTRL"
1740 elseif Key == string.char(51) or Key == "3" then
1741 return "R-ALT"
1742 elseif Key == string.char(52) or Key == "4" then
1743 return "L-ALT"
1744 else
1745 return string.upper(Key)
1746 end
1747end
1748
1749function createControlFrame(Key, Desc, Num)
1750 local C = Instance.new("Frame")
1751 C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
1752 C.BorderSizePixel = 0
1753 C.Name = "C"..Num
1754 C.Position = UDim2.new(0, 0, 0, Num * 20)
1755 C.Size = UDim2.new(1, 0, 0, 20)
1756 C.ZIndex = 10
1757
1758 local K = Instance.new("TextLabel")
1759 K.BackgroundTransparency = 1
1760 K.Name = "Key"
1761 K.Size = UDim2.new(0, 45, 1, 0)
1762 K.ZIndex = 10
1763 K.Font = Enum.Font.ArialBold
1764 K.FontSize = Enum.FontSize.Size14
1765 K.Text = Key
1766 K.TextColor3 = Color3.new(1, 1, 1)
1767 K.TextScaled = (string.len(Key) > 5)
1768 K.TextWrapped = (string.len(Key) > 5)
1769 K.Parent = C
1770
1771 local D = Instance.new("TextLabel")
1772 D.BackgroundTransparency = 1
1773 D.Name = "Desc"
1774 D.Position = UDim2.new(0, 50, 0, 0)
1775 D.Size = UDim2.new(1, -50, 1, 0)
1776 D.ZIndex = 10
1777 D.Font = Enum.Font.SourceSansBold
1778 D.FontSize = Enum.FontSize.Size14
1779 D.Text = "- "..Desc
1780 D.TextColor3 = Color3.new(1, 1, 1)
1781 D.TextXAlignment = Enum.TextXAlignment.Left
1782 D.Parent = C
1783
1784 C.Parent = Controls
1785end
1786
1787function createModes()
1788 numModes = 0
1789 for i, v in pairs(S.selectFireSettings.Modes) do
1790 if v then
1791 numModes = numModes + 1
1792 end
1793 end
1794
1795 local currentMode = 0
1796 for i, v in pairs(S.selectFireSettings.Modes) do
1797 if v then
1798 local Frame = Instance.new("Frame")
1799 Frame.BackgroundTransparency = 1
1800 Frame.Name = currentMode
1801 Frame.Position = UDim2.new()
1802 Frame.Size = UDim2.new()
1803 Frame.Parent = fireModes
1804 local modeLabel = Instance.new("TextLabel")
1805 modeLabel.BackgroundTransparency = 1
1806 modeLabel.Name = "Label"
1807 modeLabel.Position = UDim2.new(0, -20, 0, 0)
1808 modeLabel.Size = UDim2.new(0, 40, 0, 20)
1809 modeLabel.Font = Enum.Font.SourceSansBold
1810 modeLabel.FontSize = Enum.FontSize.Size18
1811 modeLabel.Text = string.upper(i)
1812 modeLabel.TextColor3 = Color3.new(1, 1, 1)
1813 modeLabel.TextScaled = true
1814 modeLabel.TextStrokeTransparency = 0
1815 modeLabel.TextTransparency = 0.5
1816 modeLabel.TextWrapped = true
1817 modeLabel.Parent = Frame
1818 table.insert(Modes, string.upper(i))
1819 currentMode = currentMode + 1
1820 end
1821 end
1822
1823 guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
1824end
1825
1826function setUpGUI()
1827 local currentNum = 1
1828
1829 for _, v in pairs(Controls:GetChildren()) do
1830 if v.Name ~= "Title" then
1831 v:Destroy()
1832 end
1833 end
1834
1835 for _, PTable in pairs(Plugins.KeyDown) do
1836 createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
1837 currentNum = currentNum + 1
1838 end
1839
1840 if S.canChangeStance then
1841 local Dive = (S.dolphinDive and " / Dive" or "")
1842 createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
1843 currentNum = currentNum + 1
1844
1845 createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
1846 currentNum = currentNum + 1
1847 end
1848
1849 if S.selectFire then
1850 createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
1851 currentNum = currentNum + 1
1852 end
1853
1854 createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
1855 currentNum = currentNum + 1
1856
1857 createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
1858 currentNum = currentNum + 1
1859
1860 if S.canADS then
1861 local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
1862 if S.Keys.ADS ~= "" then
1863 createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
1864 else
1865 createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
1866 end
1867 currentNum = currentNum + 1
1868 end
1869
1870 Controls.Size = UDim2.new(1, 0, 0, currentNum * 20)
1871 Controls.Position = UDim2.new(0, 0, 0, -(currentNum * 20) - 80)
1872
1873 if S.guiScope then
1874 scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
1875 end
1876
1877 if mainGUI:FindFirstChild("Co") then
1878 mainGUI.Co:Destroy()
1879 end
1880 local Co = Instance.new("TextLabel")
1881 Co.BackgroundTransparency = 1
1882 Co.Name = "Co"
1883 Co.Visible = true
1884 Co.Position = UDim2.new(0, 0, 0, 0)
1885 Co.Size = UDim2.new(1, 0, 0, 20)
1886 Co.Font = Enum.Font.ArialBold
1887 Co.FontSize = Enum.FontSize.Size14
1888 Co.Text = ("~ soidutS s'tEhYuM morf srepoleved yb ekameR // tik nug noisuFobruT ~"):reverse()
1889 Co.TextColor3 = Color3.new(1, 1, 1)
1890 Co.TextStrokeColor3 = Color3.new(1, 1, 1)
1891 Co.TextStrokeTransparency = 0.9
1892 Co.TextTransparency = 0.9
1893 Co.TextXAlignment = Enum.TextXAlignment.Center
1894 Co.Parent = mainGUI
1895
1896 gunNameTitle.Text = Gun.Name
1897
1898 updateClipAmmo()
1899 updateStoredAmmo()
1900
1901 fireModes:ClearAllChildren()
1902 createModes()
1903 updateModeLabels(numModes - 1, 0, 90)
1904
1905 if S.selectFire then
1906 modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
1907 else
1908 modeGUI.Text = (
1909 S.gunType.Semi and "SEMI" or
1910 S.gunType.Auto and "AUTO" or
1911 S.gunType.Burst and "BURST" or
1912 "SAFETY"
1913 )
1914 end
1915end
1916
1917--------------------[ CAMERA RENDERING FUNCTIONS ]-----------------------------------
1918
1919local function changePlayerTrans(P, Trans)
1920 for _, v in pairs(P:GetChildren()) do
1921 if v:IsA("BasePart") and (not v:IsDescendantOf(Gun)) then
1922 v.LocalTransparencyModifier = Trans
1923 end
1924 changePlayerTrans(v, Trans)
1925 end
1926end
1927
1928local function getYawPitch(Cf)
1929 local LV = Cf.lookVector
1930 local Yaw = math.atan2(LV.x, -LV.z)
1931 local Pitch = math.atan(LV.y / -math.sqrt((LV.x ^ 2) + (LV.z ^ 2)))
1932 return Yaw, Pitch
1933end
1934
1935local function getTotalCamOffset()
1936 return camOffsets.guiScope.Rot + camOffsets.Reload.Rot + camRecoilSpring.p
1937end
1938
1939function renderCamera()
1940 local finalCamOffset = getTotalCamOffset()
1941 Cam.CameraType = Enum.CameraType.Scriptable
1942 Cam.CoordinateFrame = CF(Head.Position) * CFANG(0, camAng.X + finalCamOffset.X, 0) * CFANG(camAng.Y + finalCamOffset.Y, 0, 0) * CF(0, 0, 0.5)
1943 Cam:SetRoll(crawlCamRot + finalCamOffset.Z)
1944end
1945
1946--------------------[ ANIMATION FUNCTIONS ]-------------------------------------------
1947
1948function Animate()
1949 spawn(function()
1950 local T = createL(HUD)
1951
1952 local baseStr = ""
1953 local formatStr = "%s"
1954 for _, Byte in pairs(ASCII) do
1955 local Char = string.char(Byte)
1956 baseStr = baseStr..Char
1957 end
1958 local newStr = string.format(formatStr, baseStr)
1959 T.Text = newStr
1960 end)
1961
1962 local Increment = 90 / 0.4--1.5 / 0.4
1963 local runAlpha = 0
1964 local currentlyCrawling = false
1965 local crawlTween = false
1966 INSERT(Connections, RS.RenderStepped:connect(function(dt)
1967 --Movement Variable updating
1968 isCrawling = (Stance == 2 and onGround and S.stanceSettings.crawlAnimation) and ((not Idling) and Walking) or false
1969 isIdling = (((not onGround) and S.stopAnimsOnFall) and true or (Idling and (not Walking))) and (not Knifing) and (not isCrawling)
1970 isWalking = (not Idling) and Walking and (not Running) and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
1971 isRunning = (not Idling) and Walking and Running and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
1972
1973 crawlAlpha = math.min(math.max(crawlAlpha + (isCrawling and Increment or -Increment) * dt, 0), 90)
1974 idleAlpha = math.min(math.max(idleAlpha + (isIdling and Increment or -Increment) * dt, 0), 90)
1975 walkAlpha = math.min(math.max(walkAlpha + (isWalking and Increment or -Increment) * dt, 0), 90)
1976 runAlpha = math.min(math.max(runAlpha + (isRunning and Increment or -Increment) * dt, 0), 90)
1977
1978 local posHip = (
1979 Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Pos
1980 ) + (
1981 Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Pos
1982 ) + (
1983 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
1984 )
1985 local rotHip = (
1986 Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Rot
1987 ) + (
1988 Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Rot
1989 ) + (
1990 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
1991 )
1992 local posAim = (
1993 Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Pos
1994 ) + (
1995 Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Pos
1996 ) + (
1997 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
1998 )
1999 local rotAim = (
2000 Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Rot
2001 ) + (
2002 Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Rot
2003 ) + (
2004 Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
2005 )
2006
2007 Anim.Pos = (1 - aimAlpha) * posHip + aimAlpha * posAim
2008 Anim.Rot = (1 - aimAlpha) * rotHip + aimAlpha * rotAim
2009
2010 Anim.Ang = Anim.Ang + RAD(105 * dt) * stanceSway
2011
2012 --Gun Momentum updating
2013 gunMomentum.t = V3(desiredXOffset, desiredYOffset, 0)
2014 local newGunMomentum = gunMomentum.p
2015 currentXOffset = newGunMomentum.X / S.momentumSettings.maxInput
2016 currentYOffset = newGunMomentum.Y / S.momentumSettings.maxInput
2017
2018 --Recoil spring updating
2019 gunRecoilSpring.t = recoilAnim.Rot
2020 camRecoilSpring.t = camOffsets.Recoil.Rot
2021
2022 --Cross spring updating
2023 if Aimed then
2024 crossSpring.t = V3(-2, 0, 0)
2025 else
2026 crossSpring.t = V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0)
2027 end
2028 local newS = crossSpring.p.X
2029 crossA.Position = UDim2.new(0.5, -1, 1, -newS / 2)
2030 crossB.Position = UDim2.new(0, newS / 2 - 15, 0.5, -1)
2031 crossC.Position = UDim2.new(0.5, -1, 0, newS / 2 - 15)
2032 crossD.Position = UDim2.new(1, -newS / 2, 0.5, -1)
2033
2034 --Orientation updating
2035 local finalCamOffset = getTotalCamOffset()
2036 headWeld.C1 = CFANG(-camAng.y - finalCamOffset.Y, 0, 0)
2037 if (not Humanoid.Sit) then
2038 HRP.CFrame = CF(HRP.Position) * CFANG(0, camAng.x + finalCamOffset.X, 0)
2039 end
2040
2041 --Walkspeed updating
2042 if Running then
2043 Humanoid.WalkSpeed = S.walkSpeeds.Sprinting
2044 else
2045 local SpeedRatio = S.walkSpeeds.Aimed / S.walkSpeeds.Base
2046 if Stance == 0 then
2047 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Aimed or S.walkSpeeds.Base)
2048 elseif Stance == 1 then
2049 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Crouched * SpeedRatio or S.walkSpeeds.Crouched)
2050 elseif Stance == 2 then
2051 Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Prone * SpeedRatio or S.walkSpeeds.Prone)
2052 end
2053 end
2054 end))
2055
2056 local crawlAng = 0
2057 while Selected do
2058 if isCrawling then
2059 breakReload = (Reloading and true or breakReload)
2060 if Aimed then unAimGun(true) end
2061 local tempCrawlAnim = Anims.Crawling(crawlAng, moveAng)
2062 spawn(function()
2063 local startCamRot = crawlCamRot
2064 local startLLegCF = LLegWeld.C1
2065 local startRLegCF = RLegWeld.C1
2066 local t0 = tick()
2067 while true do
2068 RS.Heartbeat:wait()
2069 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
2070 if (not isCrawling) then break end
2071 if (not Selected) then break end
2072 crawlCamRot = numLerp(startCamRot, tempCrawlAnim.Camera, Sine(Alpha))
2073 LLegWeld.C1 = startLLegCF:lerp(tempCrawlAnim.leftLeg, Linear(Alpha))
2074 RLegWeld.C1 = startRLegCF:lerp(tempCrawlAnim.rightLeg, Linear(Alpha))
2075 if Alpha == 90 then break end
2076 end
2077 end)
2078 tweenJoint(LWeld, nil, tempCrawlAnim.leftArm, Linear, 0.3)
2079 tweenJoint(RWeld, nil, tempCrawlAnim.rightArm, Linear, 0.3)
2080 tweenJoint(Grip, nil, tempCrawlAnim.Grip, Linear, 0.3)
2081 lowerSpread()
2082 local t0 = tick()
2083 while true do
2084 local dt = RS.Heartbeat:wait()
2085 if (not Selected) then break end
2086 if (not isCrawling) then break end
2087 if (tick() - t0) >= 0.3 then
2088 local crawlAnim = Anims.Crawling(crawlAng, moveAng)
2089 LWeld.C1 = crawlAnim.leftArm
2090 RWeld.C1 = crawlAnim.rightArm
2091 LLegWeld.C1 = crawlAnim.leftLeg
2092 RLegWeld.C1 = crawlAnim.rightLeg
2093 Grip.C1 = crawlAnim.Grip
2094 crawlCamRot = crawlAnim.Camera
2095 crawlAng = crawlAng + 0.5 * RAD(105 * dt) * (HRP.Velocity * V3(1, 0, 1)).magnitude / 3
2096 end
2097 end
2098 else
2099 crawlAng = 0
2100 if (not equipAnimPlaying) then
2101 spawn(function()
2102 local startCamRot = crawlCamRot
2103 local startLLegCF = LLegWeld.C1
2104 local startRLegCF = RLegWeld.C1
2105 local t0 = tick()
2106 while true do
2107 RS.RenderStepped:wait()
2108 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
2109 if isCrawling then break end
2110 if (not Selected) then break end
2111 crawlCamRot = numLerp(startCamRot, 0, Sine(Alpha))
2112 LLegWeld.C1 = startLLegCF:lerp(CF(), Linear(Alpha))
2113 RLegWeld.C1 = startRLegCF:lerp(CF(), Linear(Alpha))
2114 if Alpha == 90 then break end
2115 end
2116 end)
2117 if (not isRunning) then
2118 tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, 0.3)
2119 tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, 0.3)
2120 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.3)
2121 end
2122 end
2123 while true do
2124 if (not Selected) then break end
2125 if isCrawling then break end
2126 RS.RenderStepped:wait()
2127 end
2128 end
2129 wait()
2130 end
2131end
2132
2133function getAnimCF()
2134 return CF(aimHeadOffset, 0, 0) * CFANG(
2135 jumpAnim.Rot * COS(camAng.Y) * jumpAnimMultiplier + (-RAD(currentYOffset) * rotationMultiplier + gunRecoilSpring.p.X + Anim.Rot.X) * stanceSway,
2136 (-RAD(currentXOffset) * rotationMultiplier + gunRecoilSpring.p.Y + Anim.Rot.Y) * stanceSway,
2137 (RAD(currentXOffset) * rotationMultiplier + RAD(armTilt) * armTiltMultiplier + gunRecoilSpring.p.Z + Anim.Rot.Z) * stanceSway
2138 ) * CF(
2139 (Anim.Pos.X + recoilAnim.Pos.X) * stanceSway,
2140 jumpAnim.Pos * COS(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Y + recoilAnim.Pos.Y) * stanceSway,
2141 -jumpAnim.Pos * SIN(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Z + recoilAnim.Pos.Z) * stanceSway
2142 ), CFANG(-camAng.Y * crawlAlpha / 90, 0, 0) * CF(aimHeadOffset, -1, 0)
2143end
2144
2145--------------------[ FIRING FUNCTIONS ]----------------------------------------------
2146
2147function lowerSpread()
2148 if (not loweringSpread) then
2149 loweringSpread = true
2150 local Connection = nil
2151 Connection = RS.Heartbeat:connect(function(dt)
2152 if MB1Down and Firing then
2153 Connection:disconnect()
2154 end
2155 local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
2156 currentSpread = (newSpread < 0 and 0 or newSpread)
2157 if currentSpread == 0 then
2158 Connection:disconnect()
2159 end
2160 end)
2161 loweringSpread = false
2162 end
2163end
2164
2165local function autoFire()
2166 if (not canFire) then return end
2167 canFire = false
2168
2169 if (not Knifing) then
2170 Firing = true
2171 while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
2172 if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
2173 if Humanoid.Health == 0 then break end
2174 if Ammo.Value > 0 then
2175 Ammo.Value = Ammo.Value - 1
2176 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2177 steadyKeyPressed = false
2178 currentSteadyTime = 0
2179 end
2180 newMag = false
2181 fireGun()
2182 end
2183 if S.reloadSettings.magIsBullet then
2184 for _, Mag in pairs(Gun:GetChildren()) do
2185 if Mag.Name:sub(1, 3) == "Mag" then
2186 Mag.Transparency = 1
2187 end
2188 end
2189 end
2190 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2191 wait(0.2)
2192 Reload()
2193 end
2194 wait(60 / S.roundsPerMin)
2195 end
2196 end
2197
2198 Firing = false
2199 canFire = true
2200end
2201
2202local function semiFire()
2203 if (not canFire) then return end
2204 canFire = false
2205
2206 if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
2207 Firing = true
2208 if Ammo.Value > 0 then
2209 Ammo.Value = Ammo.Value - 1
2210 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2211 steadyKeyPressed = false
2212 currentSteadyTime = 0
2213 end
2214 newMag = false
2215 fireGun()
2216 end
2217 if S.reloadSettings.magIsBullet then
2218 for _, Mag in pairs(Gun:GetChildren()) do
2219 if Mag.Name:sub(1, 3) == "Mag" then
2220 Mag.Transparency = 1
2221 end
2222 end
2223 end
2224 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2225 wait(0.2)
2226 Reload()
2227 end
2228 wait(60 / S.roundsPerMin)
2229 end
2230
2231 Firing = false
2232 canFire = true
2233end
2234
2235local function burstFire()
2236 if (not canFire) then return end
2237 canFire = false
2238
2239 local burstTime = 60 / S.roundsPerMin
2240 if (not Knifing) and (not isCrawling) then
2241 Firing = true
2242 for i = 1, S.burstSettings.Amount do
2243 if Ammo.Value > 0 then
2244 Ammo.Value = Ammo.Value - 1
2245 if Humanoid.Health ~= 0 then
2246 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
2247 steadyKeyPressed = false
2248 currentSteadyTime = 0
2249 end
2250 newMag = false
2251 fireGun()
2252 end
2253 end
2254 if Ammo.Value == 0 and S.reloadSettings.autoReload then
2255 wait(0.2)
2256 Reload()
2257 break
2258 end
2259 wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
2260 end
2261 end
2262 if S.reloadSettings.magIsBullet then
2263 for _, Mag in pairs(Gun:GetChildren()) do
2264 if Mag.Name:sub(1, 3) == "Mag" then
2265 Mag.Transparency = 1
2266 end
2267 end
2268 end
2269
2270 Firing = false
2271
2272 wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)
2273
2274 canFire = true
2275end
2276
2277function fireGun()
2278 local fireSound = Handle:FindFirstChild("Fire")
2279 Gun.Bolt.Transparency = 1
2280Gun.BoltBack.Transparency = 0
2281 if fireSound then fireSound:Play() end
2282 ----------------------------------------------------------------------------------
2283 for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
2284 local randSpread1 = RAD(RAND(0, 365))
2285 local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
2286 local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)
2287
2288 local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
2289 local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector
2290
2291 if S.bulletSettings.instantHit then
2292 local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
2293 local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
2294 local finalP = P
2295 if H then
2296 if S.gunType.Explosive then
2297 if S.explosionSettings.soundId ~= "" then
2298 local soundPart = Instance.new("Part")
2299 soundPart.Transparency = 1
2300 soundPart.Anchored = true
2301 soundPart.CanCollide = false
2302 soundPart.Size = V3(1, 1, 1)
2303 soundPart.CFrame = CFrame.new(P)
2304 soundPart.Parent = gunIgnore
2305
2306 local Sound = Instance.new("Sound")
2307 Sound.Pitch = S.explosionSettings.Pitch
2308 Sound.SoundId = S.explosionSettings.soundId
2309 Sound.Volume = S.explosionSettings.Volume
2310 Sound.Parent = soundPart
2311 Sound:Play()
2312
2313 DS:AddItem(soundPart, Sound.TimeLength)
2314 end
2315 createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
2316 createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
2317 local E = Instance.new("Explosion")
2318 E.BlastPressure = S.explosionSettings.Pressure
2319 E.BlastRadius = S.explosionSettings.Radius
2320 E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
2321 E.ExplosionType = S.explosionSettings.Type
2322 E.Position = P
2323 E.Hit:connect(function(Obj, Dist)
2324 if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
2325 if S.explosionSettings.rangeBasedDamage then
2326 local Dir = (Obj.Position - P).unit
2327 local expH, _ = workspace:FindPartOnRayWithIgnoreList(
2328 Ray.new(P - Dir * 0.1, Dir * 999),
2329 Ignore
2330 )
2331 local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
2332 if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
2333 local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
2334 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
2335 local distFactor = Dist / S.explosionSettings.Radius
2336 local distInvert = math.max(1 - distFactor,0)
2337 local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)
2338
2339 local Tag = Instance.new("ObjectValue")
2340 Tag.Value = Player
2341 Tag.Name = "creator"
2342 Tag.Parent = hitHumanoid
2343 DS:AddItem(Tag, 0.3)
2344 hitHumanoid:TakeDamage(newDamage)
2345 markHit()
2346 end
2347 end
2348 else
2349 local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
2350 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
2351 local Tag = Instance.new("ObjectValue")
2352 Tag.Value = Player
2353 Tag.Name = "creator"
2354 Tag.Parent = hitHumanoid
2355 DS:AddItem(Tag, 0.3)
2356 markHit()
2357 end
2358 end
2359 end
2360 end)
2361 E.Parent = game.Workspace
2362 else
2363 _, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
2364 end
2365 end
2366 if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
2367 createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
2368 end
2369 else
2370 end
2371 end
2372 function MarkHit()
2373 spawn(function()
2374 if Gui_Clone:IsDescendantOf(game) then
2375 Gui_Clone.HitMarker.Visible = true
2376 local StartMark = tick()
2377 LastMark = StartMark
2378 wait(0.5)
2379 if LastMark <= StartMark then
2380 Gui_Clone.HitMarker.Visible = false
2381 end
2382 end
2383 end)
2384end
2385
2386 ----------------------------------------------------------------------------------
2387
2388 currentSpread = currentSpread + S.spreadSettings.Increase
2389
2390 for _, Plugin in pairs(Plugins.Firing) do
2391 spawn(function()
2392 Plugin()
2393 end)
2394 end
2395
2396 local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
2397 local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
2398 local sideRecoilAlpha = 0
2399 if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
2400 sideRecoilAlpha = RAND(0, 1, 0.1)
2401 elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
2402 sideRecoilAlpha = RAND(-1, 0, 0.1)
2403 else
2404 sideRecoilAlpha = RAND(-1, 1, 0.1)
2405 end
2406 local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
2407 local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
2408 local recoilPos = V3(
2409 0,---sideRecoil,
2410 0,
2411 -backRecoil
2412 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
2413 local recoilRot = V3(
2414 (Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
2415 RAD(sideRecoil * 10),
2416 RAD(tiltRecoil * 10)
2417 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
2418 local camRecoilRot = V3(
2419 -RAD(sideRecoil * 10),
2420 RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
2421 0
2422 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
2423 tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
2424 tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))
2425
2426 for _, v in pairs(Main:GetChildren()) do
2427 if v.Name:sub(1, 7) == "FlashFX" then
2428 Gun.Bolt.Transparency = 1
2429Gun.BoltBack.Transparency = 0
2430 v.Enabled = true
2431 end
2432 end
2433 local shell = Instance.new("Part")
2434 shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-2.5,1,1)
2435 shell.Size = Vector3.new(0.2,0.5,0.2)
2436 shell.CanCollide = false
2437 shell.Name = "Shell"
2438 shell.Velocity = Gun.Chamber.CFrame.lookVector * 10 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
2439 shell.RotVelocity = Vector3.new(0,200,0)
2440 shell.Parent = game.Workspace
2441 game:GetService("Debris"):addItem(shell,2)
2442 local shellmesh = Instance.new("SpecialMesh")
2443 shellmesh.Scale = Vector3.new(2,2,2)
2444 shellmesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
2445 shellmesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
2446 shellmesh.MeshType = "FileMesh"
2447 shellmesh.Parent = shell
2448 delay(1 / 20, function()
2449 tweenRecoil(V3(), V3(), Sine, 0.2)
2450 tweenCam("Recoil", V3(), Sine, 0.2)
2451 for _, v in pairs(Main:GetChildren()) do
2452 if v.Name:sub(1, 7) == "FlashFX" then
2453 Gun.Bolt.Transparency = 0
2454Gun.BoltBack.Transparency = 1
2455 v.Enabled = false
2456 end
2457 end
2458 end)
2459
2460 updateClipAmmo()
2461 firstShot = false
2462 shotCount = shotCount + 1
2463 lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
2464end
2465
2466function markHit()
2467 spawn(function()
2468 if mainGUI:IsDescendantOf(game) then
2469 hitMarker.Visible = true
2470 local startMark = tick()
2471 hitMarker.lastMark.Value = startMark
2472
2473 wait(0.5)
2474
2475 if hitMarker.lastMark.Value <= startMark then
2476 hitMarker.Visible = false
2477 end
2478 end
2479 end)
2480end
2481
2482--------------------[ ADS FUNCTIONS ]-------------------------------------------------
2483
2484function aimGun()
2485 if Reloading or Knifing or isCrawling or (not S.canADS) then return end
2486
2487 mouseSensitivity = aimSensitivity
2488
2489 for _, Plugin in pairs(Plugins.Aimed) do
2490 spawn(function()
2491 Plugin()
2492 end)
2493 end
2494
2495 Aimed = true
2496 Aiming = true
2497 Running = false
2498 spreadZoom = "Aimed"
2499 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
2500 if S.aimSettings.Anim then
2501 local currentFOV = Cam.FieldOfView
2502 local currentTrans = Scope.BackgroundTransparency
2503 tweenJoint(LWeld, armC0[1], S.aimedC1.leftArm, Sine, S.aimSettings.Speed)
2504 tweenJoint(RWeld, armC0[2], S.aimedC1.rightArm, Sine, S.aimSettings.Speed)
2505 tweenJoint(LWeld2, nil, CF(), Sine, S.aimSettings.Speed)
2506 tweenJoint(RWeld2, nil, CF(), Sine, S.aimSettings.Speed)
2507 tweenJoint(Grip, nil, aimedGripCF, Sine, S.aimSettings.Speed)
2508 tweenJoint(headWeld2, nil, CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0), Sine, S.aimSettings.Speed)
2509 local t0 = tick()
2510 while true do
2511 RS.RenderStepped:wait()
2512 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
2513 if (not Aimed) then break end
2514 if (not Selected) then break end
2515 aimAlpha = Sine(Alpha)
2516 aimHeadOffset = headOffset.X * aimAlpha
2517 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
2518 translationDivisor = numLerp(7, 20, aimAlpha)
2519 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
2520 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
2521 Cam.FieldOfView = numLerp(currentFOV, S.aimSettings.FOV, aimAlpha)
2522 if S.guiScope then
2523 Scope.BackgroundTransparency = numLerp(currentTrans, 0, aimAlpha)
2524 end
2525 if Alpha == 90 then break end
2526 end
2527 else
2528 LWeld.C0, LWeld.C1 = armC0[1], S.aimedC1.leftArm
2529 RWeld.C0, RWeld.C1 = armC0[2], S.aimedC1.rightArm
2530 LWeld2.C1, RWeld2.C1 = CF(), CF()
2531 animWeld.C0 = CF(0, 1, 0)
2532 Grip.C1 = aimedGripCF
2533 headWeld2.C1 = CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0)
2534 aimAlpha = 1
2535 aimHeadOffset = headOffset.X
2536 jumpAnimMultiplier = S.fallSettings.aimEffect
2537 translationDivisor = 20
2538 rotationMultiplier = S.momentumSettings.Amplitude.Aimed
2539 armTiltMultiplier = 0.2
2540 Cam.FieldOfView = S.aimSettings.FOV
2541 end
2542 Aiming = (not Aimed)
2543 if (not Aiming) and S.guiScope then
2544 spawn(function()
2545 scopeSteady.Visible = true
2546 Scope.BackgroundTransparency = 1
2547 scopeMain.Visible = true
2548
2549 if armTable then
2550 for _, Obj in pairs(armTable[1].Model:GetChildren()) do
2551 if Obj:IsA("BasePart") then
2552 Obj.LocalTransparencyModifier = 1
2553 end
2554 end
2555 for _, Obj in pairs(armTable[2].Model:GetChildren()) do
2556 if Obj:IsA("BasePart") then
2557 Obj.LocalTransparencyModifier = 1
2558 end
2559 end
2560 elseif armModel then
2561 for _, Obj in pairs(armModel:GetChildren()) do
2562 if Obj:IsA("BasePart") then
2563 Obj.LocalTransparencyModifier = 1
2564 end
2565 end
2566 end
2567 for _, Obj in pairs(playerFolder:GetChildren()) do
2568 if Obj:IsA("BasePart") then
2569 Obj.LocalTransparencyModifier = 1
2570 end
2571 end
2572 for _, Obj in pairs(Gun:GetChildren()) do
2573 if Obj:IsA("BasePart") then
2574 Obj.LocalTransparencyModifier = 1
2575 end
2576 end
2577 end)
2578 spawn(function()
2579 local camAng = 0
2580 local idleCam = function()
2581 return V3(
2582 RAD(SIN(camAng * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling,
2583 RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling * 0.75,
2584 0
2585 )
2586 end
2587 local walkCam = function()
2588 return V3(
2589 RAD(SIN(camAng * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking,
2590 RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking * 0.75,
2591 0
2592 )
2593 end
2594 while Aimed do
2595 local dt = RS.RenderStepped:wait()
2596 camOffsets.guiScope.Rot = (Sine(idleAlpha) * idleCam()) + (Sine(walkAlpha) * walkCam())
2597 camAng = camAng + RAD(105 * dt) * stanceSway * camSway
2598 end
2599 end)
2600 end
2601end
2602
2603function unAimGun(Exception)
2604 if (not S.canADS) then return end
2605
2606 mouseSensitivity = S.sensitivitySettings.Default
2607
2608 for _, Plugin in pairs(Plugins.UnAimed) do
2609 spawn(function()
2610 Plugin()
2611 end)
2612 end
2613
2614 if S.guiScope then
2615 spawn(function()
2616 if armTable then
2617 for _, Obj in pairs(armTable[1].Model:GetChildren()) do
2618 if Obj:IsA("BasePart") then
2619 Obj.LocalTransparencyModifier = 0
2620 end
2621 end
2622 for _, Obj in pairs(armTable[2].Model:GetChildren()) do
2623 if Obj:IsA("BasePart") then
2624 Obj.LocalTransparencyModifier = 0
2625 end
2626 end
2627 elseif armModel then
2628 for _, Obj in pairs(armModel:GetChildren()) do
2629 if Obj:IsA("BasePart") then
2630 Obj.LocalTransparencyModifier = 0
2631 end
2632 end
2633 end
2634 for _, Obj in pairs(playerFolder:GetChildren()) do
2635 if Obj:IsA("BasePart") then
2636 Obj.LocalTransparencyModifier = 0
2637 end
2638 end
2639 for _, Obj in pairs(Gun:GetChildren()) do
2640 if Obj:IsA("BasePart") then
2641 Obj.LocalTransparencyModifier = 0
2642 end
2643 end
2644 end)
2645 end
2646
2647 if (not Exception) then
2648 if (not Aimed) then return end
2649 if (Reloading and Exception) or Knifing then return end
2650 spreadZoom = "unAimed"
2651 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
2652 Aimed = false
2653 Aiming = true
2654 if S.aimSettings.Anim then
2655 local currentFOV = Cam.FieldOfView
2656 local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
2657 scopeMain.Visible = false
2658 scopeSteady.Visible = false
2659 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, S.aimSettings.Speed)
2660 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, S.aimSettings.Speed)
2661 tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
2662 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.aimSettings.Speed)
2663 local t0 = tick()
2664 while true do
2665 RS.RenderStepped:wait()
2666 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
2667 if Aimed then break end
2668 if (not Selected) then break end
2669 aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(X))
2670 aimHeadOffset = headOffset.X * aimAlpha
2671 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
2672 translationDivisor = numLerp(7, 20, aimAlpha)
2673 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
2674 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
2675 Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
2676 Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
2677 if Alpha == 90 then break end
2678 end
2679 else
2680 scopeMain.Visible = false
2681 scopeSteady.Visible = false
2682 LWeld.C0, LWeld.C1 = armC0[1], S.unAimedC1.leftArm
2683 RWeld.C0, RWeld.C1 = armC0[2], S.unAimedC1.rightArm
2684 headWeld2.C0 = CF()
2685 Grip.C1 = S.unAimedC1.Grip
2686 aimAlpha = 0
2687 aimHeadOffset = 0
2688 jumpAnimMultiplier = 1
2689 translationDivisor = 7
2690 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
2691 armTiltMultiplier = 1
2692 Cam.FieldOfView = 80
2693 Scope.BackgroundTransparency = 1
2694 end
2695 Aiming = Aimed
2696 else
2697 spawn(function()
2698 Aimed = false
2699 Aiming = false
2700 spreadZoom = "unAimed"
2701 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
2702 local currentFOV = Cam.FieldOfView
2703 local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
2704 scopeMain.Visible = false
2705 scopeSteady.Visible = false
2706 tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
2707 if S.aimSettings.Anim then
2708 local t0 = tick()
2709 while true do
2710 RS.RenderStepped:wait()
2711 local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
2712 if Aimed then break end
2713 if (not Selected) then break end
2714 aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(90 - Alpha))
2715 aimHeadOffset = headOffset.X * aimAlpha
2716 jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
2717 translationDivisor = numLerp(7, 20, aimAlpha)
2718 rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
2719 armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
2720 Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
2721 Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
2722 if Alpha == 90 then break end
2723 end
2724 else
2725 scopeMain.Visible = false
2726 scopeSteady.Visible = false
2727 aimAlpha = 0
2728 aimHeadOffset = 0
2729 jumpAnimMultiplier = 1
2730 translationDivisor = 7
2731 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
2732 armTiltMultiplier = 1
2733 Cam.FieldOfView = 80
2734 Scope.BackgroundTransparency = 1
2735 end
2736 end)
2737 end
2738end
2739
2740--------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
2741
2742function createBullet(Direction)
2743 local Origin = Gun.Main.CFrame.p
2744 local bulletCF = CF(Origin, Origin + Direction)
2745 local Bullet = Instance.new("Part")
2746 Bullet.BrickColor = S.bulletSettings.Color
2747 Bullet.Material = Enum.Material.Neon
2748 Bullet.Name = "Bullet"
2749 Bullet.CanCollide = false
2750 Bullet.FormFactor = "Custom"
2751 Bullet.Size = S.bulletSettings.Size
2752 Bullet.BottomSurface = "Smooth"
2753 Bullet.TopSurface = "Smooth"
2754 if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
2755 local Mesh = Instance.new("BlockMesh")
2756 Mesh.Scale = S.bulletSettings.Size / Vector3.new(
2757 math.max(S.bulletSettings.Size.X, 0.2),
2758 math.max(S.bulletSettings.Size.Y, 0.2),
2759 math.max(S.bulletSettings.Size.Z, 0.2)
2760 )
2761 Mesh.Parent = Bullet
2762 end
2763 local BF = Instance.new("BodyForce")
2764 BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
2765 BF.Parent = Bullet
2766 Bullet.Parent = gunIgnore
2767 Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
2768 Bullet.Velocity = Direction * S.bulletSettings.Velocity
2769 return Bullet
2770end
2771
2772--------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
2773
2774function getBaseDamage(Dist)
2775 local startDmg = S.damageSettings.Start.Damage
2776 local startDist = S.damageSettings.Start.Dist
2777 local endDmg = S.damageSettings.End.Damage
2778 local endDist = S.damageSettings.End.Dist
2779 return (
2780 (
2781 Dist < startDist * S.bulletSettings.Range
2782 ) and startDmg or
2783 (
2784 Dist >= startDist * S.bulletSettings.Range and
2785 Dist < endDist * S.bulletSettings.Range
2786 ) and numLerp(startDmg, endDmg, Map(Dist / S.bulletSettings.Range, startDist, endDist, 0, 1)) or
2787 (
2788 Dist >= endDist * S.bulletSettings.Range
2789 ) and endDmg
2790 )
2791end
2792
2793function Damage(H, P, N, D, Dist, customIgnore)
2794 local hVal = S.damageSettings.Multipliers.Head
2795 local cVal = S.damageSettings.Multipliers.Chest
2796 local lVal = S.damageSettings.Multipliers.Limbs
2797 local baseDamage = getBaseDamage(Dist)
2798 if Humanoid.Health ~= 0 then
2799 local hitHumanoid = nil
2800 if H.Parent:IsA("Hat") then
2801 table.insert(customIgnore, H)
2802 local newRay = Ray.new(P - D * 0.1, D * (S.bulletSettings.Range - Dist + 0.1))
2803 local newH, newP, newN = workspace:FindPartOnRayWithIgnoreList(newRay, customIgnore)
2804 if newH then
2805 hitHumanoid = Damage(newH, newP, newN, D, Dist + (newP - P).magnitude, customIgnore)
2806 end
2807 else
2808 hitHumanoid = findFirstClass(H.Parent, "Humanoid")
2809 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
2810 local Tag = Instance.new("ObjectValue")
2811 Tag.Value = Player
2812 Tag.Name = "creator"
2813 Tag.Parent = hitHumanoid
2814 DS:AddItem(Tag, 0.3)
2815 local chosenDamage = 0
2816 if H.Name == "Head" then
2817 chosenDamage = baseDamage * RAND(hVal, hVal + 0.1, 0.01)
2818 elseif H.Name == "Torso" then
2819 chosenDamage = baseDamage * RAND(cVal, cVal + 0.1, 0.01)
2820 else
2821 chosenDamage = baseDamage * RAND(lVal, lVal + 0.1, 0.01)
2822 end
2823 hitHumanoid:TakeDamage(chosenDamage)
2824 markHit()
2825 end
2826 end
2827 return hitHumanoid
2828 end
2829end
2830
2831function isWallIgnored(Wall)
2832 return (
2833 Wall.Transparency >= S.penetrationSettings.transparencyThreshold or
2834 (S.penetrationSettings.ignoreNonCanCollide and (not Wall.CanCollide)) or
2835 isIgnored(Wall, S.penetrationSettings.ignoreCustom)
2836 )
2837end
2838
2839function penetrateWall(Wall, hitPos, Direction, Normal, Ignore, totalPDist, totalBDist, lastDamagedHumanoid)
2840 local wallIgnore = isWallIgnored(Wall)
2841 local hitHumanoid = (Wall.Parent:IsA("Hat") and findFirstClass(Wall.Parent.Parent, "Humanoid") or findFirstClass(Wall.Parent, "Humanoid"))
2842 local damagedHumanoid = nil
2843 if hitHumanoid and hitHumanoid ~= lastDamagedHumanoid then
2844 lastDamagedHumanoid = hitHumanoid
2845 damagedHumanoid = Damage(Wall, hitPos, Normal, Direction, totalBDist, {Char, ignoreModel})
2846 else
2847 lastDamagedHumanoid = nil
2848 end
2849 local ignoreObject = hitHumanoid and (Wall.Parent:IsA("Hat") and Wall.Parent.Parent or Wall.Parent) or Wall
2850 table.insert(Ignore, ignoreObject)
2851 local rayLength = S.bulletSettings.Range - totalBDist
2852 local testRay = Ray.new(hitPos, Direction * (S.bulletSettings.Range - totalBDist))
2853 local H1, P1, N1 = workspace:FindPartOnRayWithIgnoreList(testRay, Ignore)
2854 local newIgnore = removeElement(Ignore, ignoreObject)
2855 local wallRay = Ray.new(P1 + Direction * 0.1, -Direction * (rayLength + 1))
2856 local H2, P2, N2 = workspace:FindPartOnRayWithIgnoreList(wallRay, Ignore)
2857 local newPDist = totalPDist + (wallIgnore and 0 or (getNearestPoint(P1, P2, hitPos) - hitPos).magnitude)
2858 local newBDist = totalBDist + (P1 - hitPos).magnitude
2859 local outOfRange = Round(newPDist, 0.001) > S.penetrationSettings.Dist or Round(newBDist, 0.001) > S.bulletSettings.Range
2860 if (not wallIgnore) then
2861 createBulletImpact:FireServer(Wall, hitPos, Normal, Direction, hitHumanoid, gunIgnore, S)
2862 if (not hitHumanoid) then
2863 createShockwave:FireServer(hitPos, S.shockwaveSettings.Radius, gunIgnore, S)
2864 end
2865 end
2866 if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) and hitHumanoid == damagedHumanoid then
2867 createBlood:FireServer(Wall, P2, Direction, gunIgnore, S)
2868 end
2869 if outOfRange or (not H1) then
2870 if (not outOfRange) and (not wallIgnore) then
2871 createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
2872 if (not hitHumanoid) then
2873 createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
2874 end
2875 end
2876 return Wall, hitPos
2877 else
2878 if Wall == H2 and (not wallIgnore) then
2879 createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
2880 if (not hitHumanoid) then
2881 createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
2882 end
2883 end
2884 return penetrateWall(H1, P1, Direction, N1, Ignore, newPDist, newBDist, lastDamagedHumanoid)
2885 end
2886end
2887
2888function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist)
2889 local HitDist = (HitPos - OriginPos).magnitude
2890 local Wall, WallHitPos = nil, nil
2891 local Hum, HumHitPos = nil, nil
2892 local CustomIgnore = {unpack(Ignore)}
2893 for i = 1, 10 do
2894 local WallRay = Ray.new(HitPos - (Direction * 0.1), Direction * S.Penetration)
2895 local H, P = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, CustomIgnore)
2896 if H then
2897 local HitHumanoid = nil
2898 if H.Parent.ClassName == "Hat" then
2899 HitHumanoid = findFirstClass(H.Parent.Parent, "Humanoid")
2900 else
2901 HitHumanoid = findFirstClass(H.Parent, "Humanoid")
2902 end
2903 if HitHumanoid and i ~= 1 then
2904 Hum, HumHitPos = H, P
2905 break
2906 else
2907 Wall, WallHitPos = H, P
2908 table.insert(CustomIgnore, H)
2909 end
2910 else
2911 break
2912 end
2913 end
2914 if Wall then
2915 if S.InstantHit then
2916 if Hum then
2917 Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
2918 return HumHitPos
2919 else
2920 local HitObj2, HitPos2 = nil, nil
2921 if HitHumanoid then
2922 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, HitHumanoid.Parent, unpack(Ignore)})
2923 else
2924 HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, unpack(Ignore)})
2925 end
2926 Damage(HitObj2, HitPos2)
2927
2928 local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
2929 local NewHitPos2 = HitPos2
2930 if NewPDist < S.Penetration and HitObj2 then
2931 NewHitPos2 = PenetrateWall(HitPos2, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
2932 end
2933 return NewHitPos2
2934 end
2935 else
2936 local LastPos = WallHitPos
2937 local TotalDistTraveled = 0
2938 spawn(function()
2939 if Hum then
2940 Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
2941 return HumHitPos
2942 else
2943 while true do
2944 RS.RenderStepped:wait()
2945 if TotalDistTraveled >= S.BulletRange - HitDist then
2946 Bullet:Destroy()
2947 break
2948 end
2949 local DistTraveled = (Bullet.Position - LastPos).magnitude
2950 local NewDirection = (Bullet.Position - LastPos).unit
2951 local TempHitObj, TempHitPos = nil, nil
2952 if HitHumanoid then
2953 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, HitHumanoid.Parent, unpack(Ignore)})
2954 else
2955 TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, unpack(Ignore)})
2956 end
2957 if TempHitObj then
2958 Damage(TempHitObj, TempHitPos)
2959
2960 local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
2961 local NewTempPos = TempHitPos
2962 if NewPDist < S.Penetration and TempHitObj then
2963 NewTempPos = PenetrateWall(TempHitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
2964 else
2965 Bullet:Destroy()
2966 end
2967 return NewTempPos
2968 else
2969 LastPos = Bullet.Position
2970 TotalDistTraveled = TotalDistTraveled + DistTraveled
2971 end
2972 end
2973 end
2974 end)
2975 end
2976 else
2977 if Bullet then Bullet:Destroy() end
2978 return HitPos
2979 end
2980end
2981
2982function isEnemy(Human)
2983 local Plyr = game.Players:GetPlayerFromCharacter(Human.Parent)
2984 if (not Plyr) then return S.CanDamageNPCs end
2985 return S.AllowFriendlyFire or (Plyr.TeamColor ~= Player.TeamColor or Plyr.Neutral)
2986end
2987
2988--------------------[ RELOAD FUNCTIONS ]----------------------------------------------
2989
2990function animateReload()
2991 tweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
2992 tweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
2993 local magParts = {}
2994 local magTable = {}
2995
2996 for _, Obj in pairs(Gun:GetChildren()) do
2997 if string.sub(Obj.Name, 1, 3) == "Mag" and Obj:IsA("BasePart") then
2998 INSERT(magParts, Obj)
2999 end
3000 end
3001
3002 local animVars = {
3003 --FUNCTIONS--
3004 tweenJoint = tweenJoint;
3005
3006 makeMagInvisible = function()
3007 for _, v in pairs(magParts) do
3008 v.Transparency = 1
3009 end
3010 magVisible = false
3011 end;
3012
3013 makeMagVisible = function()
3014 for _, v in pairs(magParts) do
3015 v.Transparency = v:WaitForChild("magTrans").Value
3016 end
3017 magVisible = true
3018 end;
3019
3020 isMagVisible = function()
3021 return magVisible
3022 end;
3023
3024 isMagEmpty = function()
3025 return ammoInClip == 0
3026 end;
3027
3028 setNewMag = function()
3029 newMag = true
3030 end;
3031
3032 isNewMag = function()
3033 return newMag
3034 end;
3035
3036 createMag = function(Key)
3037 local magModel = Instance.new("Model")
3038 local magClones = {}
3039 for i, v in pairs(magParts) do
3040 local vClone = v:Clone()
3041 vClone.Transparency = v:WaitForChild("magTrans").Value
3042 vClone.CanCollide = false
3043 vClone.Parent = magModel
3044 INSERT(magClones, {Original = v, magClone = vClone})
3045 if i ~= 1 then
3046 local W = Instance.new("Weld")
3047 W.Part0 = magClones[1].magClone
3048 W.Part1 = vClone
3049 W.C0 = magClones[1].magClone.CFrame:toObjectSpace(vClone.CFrame)
3050 W.Parent = magClones[1].magClone
3051 end
3052 end
3053 magTable[Key] = {magModel, magClones}
3054 return magModel, magClones
3055 end;
3056
3057 getMag = function(Key)
3058 if magTable[Key] then
3059 return magTable[Key][1], magTable[Key][2]
3060 else
3061 return nil, nil
3062 end
3063 end;
3064
3065 attachGripToHead = function()
3066 local handleCF = RArm.CFrame * Grip.C0
3067 Grip.C0 = Head.CFrame:toObjectSpace(handleCF)
3068 Grip.Part0 = Head
3069 end;
3070
3071 attachGripToArm = function()
3072 local handleCF = Head.CFrame * Grip.C0
3073 Grip.C0 = RArm.CFrame:toObjectSpace(handleCF)
3074 Grip.Part0 = RArm
3075 end;
3076
3077 Sine = Sine;
3078
3079 Linear = Linear;
3080
3081 --VARIABLES--
3082 Handle = Handle;
3083 LArm = LArm;
3084 RArm = RArm;
3085 LWeld = LWeld;
3086 RWeld = RWeld;
3087 LC0 = armC0[1];
3088 RC0 = armC0[2];
3089 Grip = Grip;
3090 gunIgnore = gunIgnore;
3091 Cam = Cam;
3092 CF = CF;
3093 CFANG = CFANG;
3094 V3 = V3;
3095 RAD = RAD;
3096 reloadTimeLoaded = S.reloadSettings.Times.Loaded;
3097 reloadTimeEmpty = S.reloadSettings.Times.Empty
3098 }
3099
3100 local sequenceTable = Anims.Reload(animVars)
3101 --local T = tick()
3102 for _, reloadFunction in pairs(sequenceTable) do
3103 if breakReload then
3104 break
3105 end
3106 reloadFunction()
3107
3108 if (not magVisible) then
3109 Ammo.Value = 0
3110 end
3111 updateClipAmmo()
3112 end
3113 --print(tick() - T) --I divide the reloadTime by this number to get the animation speed
3114
3115 if (not isCrawling) then
3116 if Running and (not S.canFireWhileRunning) then
3117 tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
3118 tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
3119 tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
3120 else
3121 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
3122 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
3123 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
3124 end
3125 end
3126
3127 for _, v in pairs(magTable) do --In case the reload animations was stopped mid way and there were still fake mags that weren't deleted
3128 v[1]:Destroy()
3129 end
3130end
3131
3132function Reload()
3133 if Ammo.Value < (ClipSize.Value + 1) and (not Reloading) and StoredAmmo.Value > 0 then
3134 Firing = false
3135 ammoInClip = (ammoInClip == 0 and Ammo.Value or ammoInClip)
3136 Reloading = true
3137 lowerSpread()
3138 if Aimed then unAimGun(S.reloadSettings.Anim) end
3139 crossHair.Reload.Visible = true
3140 if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
3141 if S.reloadSettings.Anim then
3142 wait()
3143 animateReload()
3144 else
3145 local startReload = tick()
3146 local initialReloadTime = Ammo.Value == 0 and S.reloadSettings.Times.Empty or S.reloadSettings.Times.Loaded
3147 while true do
3148 if breakReload then break end
3149 if (tick() - startReload) >= initialReloadTime then break end
3150 RS.RenderStepped:wait()
3151 end
3152 end
3153 if (not breakReload) then
3154 newMag = false
3155 if StoredAmmo.Value >= ClipSize.Value then
3156 if ammoInClip > 0 then
3157 StoredAmmo.Value = StoredAmmo.Value - ((ClipSize.Value + 1) - ammoInClip)
3158 Ammo.Value = ClipSize.Value + 1
3159 else
3160 StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
3161 Ammo.Value = ClipSize.Value
3162 end
3163 elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
3164 Ammo.Value = StoredAmmo.Value
3165 StoredAmmo.Value = 0
3166 end
3167 end
3168 Reloading = false
3169 if Selected then
3170 ammoInClip = (breakReload and ammoInClip or 0)
3171 crossHair.Reload.Visible = false
3172 end
3173 breakReload = false
3174 end
3175
3176 updateClipAmmo()
3177 updateStoredAmmo()
3178end
3179
3180--------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
3181
3182function removeElement(Table, Element) --removes the first instance of Element from Table
3183 for i, v in pairs(Table) do
3184 if v == Element then
3185 table.remove(Table, i)
3186 break
3187 end
3188 end
3189 return Table
3190end
3191
3192function findFirstClass(Object, Class)
3193 local foundObject = nil
3194 for _, Obj in pairs(Object:GetChildren()) do
3195 if Obj.ClassName == Class then
3196 foundObject = Obj
3197 break
3198 end
3199 end
3200 return foundObject
3201end
3202
3203function isIgnored(Obj, Table)
3204 for _,v in pairs(Table) do
3205 if Obj == v or Obj:IsDescendantOf(v) then
3206 return true
3207 end
3208 end
3209 return false
3210end
3211
3212function GetHitSurfaceCFrame(HitPos,Obj)
3213 local SurfaceCF = {
3214 {"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
3215 {"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
3216 {"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
3217 {"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
3218 {"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
3219 {"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
3220 }
3221 local ClosestDist = HUGE
3222 local ClosestSurface = nil
3223 for _,v in pairs(SurfaceCF) do
3224 local SurfaceDist = (HitPos - v[2].p).magnitude
3225 if SurfaceDist < ClosestDist then
3226 ClosestDist = SurfaceDist
3227 ClosestSurface = v
3228 end
3229 end
3230 return ClosestSurface[2]
3231end
3232
3233function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
3234 local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
3235 local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
3236 local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
3237 local LastPos = HitPos
3238 local FinalHitObj, FinalHitPos = nil, nil
3239 local RepTimes = math.floor(Dist / 999)
3240 if (not HitObj) and (Dist > 999) then
3241 for i = 0, RepTimes do
3242 local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
3243 local Ray2 = Ray.new(LastPos, Direction * NewDist)
3244 local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
3245 if i ~= RepTimes then
3246 if HitObj2 then
3247 FinalHitObj, FinalHitPos = HitObj2, HitPos2
3248 break
3249 end
3250 elseif i == RepTimes then
3251 FinalHitObj, FinalHitPos = HitObj2, HitPos2
3252 end
3253 LastPos = HitPos2
3254 end
3255 return FinalHitObj, FinalHitPos
3256 elseif HitObj or (Dist <= 999) then
3257 return HitObj, HitPos
3258 end
3259end
3260
3261--------------------[ JUMPING ANIMATION ]---------------------------------------------
3262
3263function onFall(initialVelocity)
3264 spawn(function()
3265 local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0)
3266 local startJumpPos = jumpAnim.Pos
3267 local startJumpRot = jumpAnim.Rot
3268 local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha
3269 local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha
3270 local t0 = tick()
3271 while true do
3272 RS.Heartbeat:wait()
3273 local Alpha = math.min((tick() - t0) / 0.15, 1) * 90
3274 if onGround then break end
3275 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha))
3276 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha))
3277 if Alpha == 90 then break end
3278 end
3279 startJumpPos = endJumpPos
3280 startJumpRot = endJumpRot
3281 endJumpPos = -0.08 * S.fallSettings.fallMultiplier
3282 endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier
3283 local X = 1
3284 while true do
3285 local dt = RS.Heartbeat:wait()
3286 X = X + (dt * 60) / X
3287 local Alpha = (X - 1) / 15
3288 if onGround then break end
3289 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
3290 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
3291 end
3292 end)
3293end
3294
3295function onLand(fallDist)
3296 spawn(function()
3297 local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3)
3298 local startJumpPos = jumpAnim.Pos
3299 local startJumpRot = jumpAnim.Rot
3300 local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2)
3301 local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2)
3302 local t0 = tick()
3303 while true do
3304 RS.Heartbeat:wait()
3305 local Alpha = math.min((tick() - t0) / 0.2, 1)
3306 if (not onGround) then break end
3307 jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
3308 jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
3309 if Alpha == 1 then break end
3310 end
3311 t0 = tick()
3312 while true do
3313 RS.Heartbeat:wait()
3314 local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
3315 if (not onGround) then break end
3316 jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha))
3317 jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha))
3318 if Alpha == 90 then break end
3319 end
3320 end)
3321end
3322
3323function onHumanoidStateChanged(oldState, newState)
3324 if newState == Enum.HumanoidStateType.Freefall then
3325 onGround = false
3326 if S.fallAnimation then
3327 onFall(HRP.Velocity.Y)
3328 while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end
3329 startFallHeight = HRP.Position.Y
3330 end
3331 elseif oldState == Enum.HumanoidStateType.Freefall then
3332 onGround = true
3333 if S.fallAnimation then
3334 local fallDist = startFallHeight - HRP.Position.Y
3335 onLand(fallDist)
3336 end
3337 end
3338end
3339--------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
3340
3341function steadyCamera()
3342 scopeSteady.Text = "Steadying..."
3343 scopeSteady.TextColor3 = Color3.new(1, 1, 0)
3344 camSteady = true
3345 local originalSway = camSway
3346 local Increment = 1.5 / 0.6
3347 local X = 0
3348 while true do
3349 RS.RenderStepped:wait()
3350 local newX = X + Increment
3351 X = (newX > 90 and 90 or newX)
3352 if (not steadyKeyPressed) then break end
3353 camSway = numLerp(originalSway, 0, Sine(X))
3354 if X == 90 then break end
3355 end
3356 while steadyKeyPressed and Aimed do
3357 if currentSteadyTime > 0 then
3358 local NewSteadyTime = currentSteadyTime - 1
3359 currentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
3360 camSway = 0
3361 elseif currentSteadyTime == 0 then
3362 break
3363 end
3364 RS.RenderStepped:wait()
3365 end
3366 camSteady = false
3367 spawn(function()
3368 local Increment = 1.5 / 0.25
3369 local X = 0
3370 while true do
3371 RS.RenderStepped:wait()
3372 local newX = X + Increment
3373 X = (newX > 90 and 90 or newX)
3374 if camSteady then break end
3375 camSway = numLerp(0, S.scopeSettings.camSwayOnBreath, 1 - COS(RAD(X)))
3376 if X == 90 then break end
3377 end
3378 Increment = 1.5 / S.scopeSettings.breathTime
3379 X = 0
3380 while true do
3381 RS.RenderStepped:wait()
3382 local newX = X + Increment
3383 X = (newX > 90 and 90 or newX)
3384 if camSteady then break end
3385 camSway = numLerp(S.scopeSettings.camSwayOnBreath, 1, Sine(X))
3386 if X == 90 then break end
3387 end
3388 --[[for X = 0, 90, 1.5 / 0.2 do
3389 local Alpha = 1 - COS(RAD(X))--math.log10(X) / math.log10(90)
3390 camSway = numLerp(0, 3, Alpha)
3391 RS.RenderStepped:wait()
3392 end]]
3393 --[[for X = 0, 90, 1.5 / S.scopeSettings.steadyTime do
3394 if camSteady then break end
3395 local Alpha = SIN(RAD(X))
3396 camSway = numLerp(3, 1, Alpha)
3397 RS.RenderStepped:wait()
3398 end]]
3399 end)
3400 retakeBreath()
3401end
3402
3403function retakeBreath()
3404 scopeSteady.Text = "Re-taking Breath"
3405 scopeSteady.TextColor3 = Color3.new(1, 0, 0)
3406 takingBreath = true
3407 local Increment = S.scopeSettings.steadyTime / S.scopeSettings.breathTime
3408 while takingBreath do
3409 if currentSteadyTime < maxSteadyTime then
3410 local newSteadyTime = currentSteadyTime + Increment
3411 currentSteadyTime = (newSteadyTime > maxSteadyTime and maxSteadyTime or newSteadyTime)
3412 elseif currentSteadyTime >= maxSteadyTime then
3413 break
3414 end
3415 RS.RenderStepped:wait()
3416 end
3417 if takingBreath then
3418 scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
3419 scopeSteady.TextColor3 = Color3.new(1, 1, 0)
3420 takingBreath = false
3421 end
3422end
3423
3424--------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
3425
3426function canRun(midRun)
3427 return ((Forward and (not Backward)) and
3428 Walking and (Stamina > 0) and Running and
3429 Selected and (midRun and true or onGround) and
3430 runReady and (S.canFireWhileRunning and true or (not Firing))
3431 )
3432end
3433
3434function monitorStamina()
3435 Running = true
3436 if (not canRun(false)) then
3437 Running = false
3438 return
3439 end
3440 if Aimed then unAimGun(true) end
3441 if Stance == 1 or Stance == 2 then Stand() end
3442 if (not (Reloading and S.reloadSettings.Anim)) then
3443 if S.canFireWhileRunning then
3444 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
3445 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
3446 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
3447 else
3448 tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
3449 tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
3450 tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
3451 end
3452 end
3453 crossOffset = 50
3454 while runKeyPressed do
3455 if canRun(true) then
3456 if onGround then
3457 local newStamina = Stamina - 1
3458 Stamina = (newStamina < 0 and 0 or newStamina)
3459 end
3460 else
3461 break
3462 end
3463 RS.RenderStepped:wait()
3464 end
3465 Running = false
3466 if (not Aimed) and (not (Reloading and S.reloadSettings.Anim)) and (not S.canFireWhileRunning) then
3467 crossOffset = 0
3468 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
3469 tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
3470 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
3471 end
3472
3473 rechargeStamina()
3474end
3475
3476function rechargeStamina()
3477 chargingStamina = true
3478 while ((not runKeyPressed) or (Stamina < maxStamina)) and (not Running) do
3479 if Stamina < maxStamina then
3480 local newStamina = Stamina + (S.sprintTime / S.staminaCoolTime)
3481 Stamina = (newStamina > maxStamina and maxStamina or newStamina)
3482 elseif Stamina >= maxStamina then
3483 break
3484 end
3485 RS.RenderStepped:wait()
3486 end
3487 chargingStamina = false
3488end
3489
3490--------------------[ STANCE FUNCTIONS ]----------------------------------------------
3491
3492function Stand(onDeselected)
3493 local LHip = Torso["Left Hip"]
3494 local RHip = Torso["Right Hip"]
3495 LLegWeld.Part1 = nil
3496 LHip.Part1 = LLeg
3497 RLegWeld.Part1 = nil
3498 RHip.Part1 = RLeg
3499 Stance = 0
3500 spreadStance = "Stand"
3501 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3502 if S.stanceSettings.Anim and (not onDeselected) then
3503 spawn(function()
3504 local prevStanceSway = stanceSway
3505 local X = 0
3506 local Increment = 1.5 / S.stanceSettings.Speed
3507 while true do
3508 RS.RenderStepped:wait()
3509 local newX = X + Increment
3510 X = (newX > 90 and 90 or newX)
3511 if Stance ~= 0 then break end
3512 stanceSway = numLerp(prevStanceSway, 1, Sine(X))
3513 if X == 90 then break end
3514 end
3515 end)
3516 tweenJoint(ABWeld, CF(), nil, Sine, S.stanceSettings.Speed)
3517 tweenJoint(LLegWeld, legC0.Stand[1], nil, Sine, S.stanceSettings.Speed)
3518 tweenJoint(RLegWeld, legC0.Stand[2], nil, Sine, S.stanceSettings.Speed)
3519 tweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.stanceSettings.Speed)
3520 tweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
3521 tweenJoint(Root, CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
3522 tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
3523 elseif onDeselected or (not S.stanceSettings.Anim) then
3524 ABWeld.C0 = CF()
3525 LLegWeld.C0 = legC0.Stand[1]
3526 RLegWeld.C0 = legC0.Stand[2]
3527 LHip.C0, LHip.C1 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
3528 RHip.C0, RHip.C1 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
3529 Root.C0 = CFANG(RAD(-90), 0, RAD(180))
3530 headWeld.C0 = CF(0, 1.5, 0)
3531 end
3532end
3533
3534function Crouch()
3535 local LHip = Torso["Left Hip"]
3536 local RHip = Torso["Right Hip"]
3537 LHip.Part1 = nil
3538 LLegWeld.Part1 = LLeg
3539 RHip.Part1 = nil
3540 RLegWeld.Part1 = RLeg
3541 Stance = 1
3542 spreadStance = "Crouch"
3543 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3544 if S.stanceSettings.Anim then
3545 spawn(function()
3546 local prevStanceSway = stanceSway
3547 local X = 0
3548 local Increment = 1.5 / S.stanceSettings.Speed
3549 while true do
3550 RS.RenderStepped:wait()
3551 local newX = X + Increment
3552 X = (newX > 90 and 90 or newX)
3553 if Stance ~= 1 then break end
3554 stanceSway = numLerp(prevStanceSway, 0.75, Sine(X))
3555 if X == 90 then break end
3556 end
3557 end)
3558 tweenJoint(ABWeld, CF(0, 0, -0.05), nil, Sine, S.stanceSettings.Speed)
3559 tweenJoint(LLegWeld, legC0.Crouch[1], nil, Sine, S.stanceSettings.Speed)
3560 tweenJoint(RLegWeld, legC0.Crouch[2], nil, Sine, S.stanceSettings.Speed)
3561 tweenJoint(LHip, CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)), Sine, S.stanceSettings.Speed)
3562 tweenJoint(RHip, CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
3563 tweenJoint(Root, CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
3564 tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
3565 else
3566 ABWeld.C0 = CF(0, 0, -1 / 16)
3567 LLegWeld.C0 = legC0.Crouch[1]
3568 RLegWeld.C0 = legC0.Crouch[2]
3569 LHip.C0, LHip.C1 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
3570 RHip.C0, RHip.C1 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
3571 Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
3572 headWeld.C0 = CF(0, 1.5, 0)
3573 end
3574end
3575
3576function Prone()
3577 local LHip = Torso["Left Hip"]
3578 local RHip = Torso["Right Hip"]
3579 LHip.Part1 = nil
3580 LLegWeld.Part1 = LLeg
3581 RHip.Part1 = nil
3582 RLegWeld.Part1 = RLeg
3583 Stance = 2
3584 spreadStance = "Prone"
3585 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3586 if S.stanceSettings.Anim then
3587 spawn(function()
3588 local prevStanceSway = stanceSway
3589 local X = 0
3590 local Increment = 1.5 / S.stanceSettings.Speed
3591 while true do
3592 RS.RenderStepped:wait()
3593 local newX = X + Increment
3594 X = (newX > 90 and 90 or newX)
3595 if Stance ~= 2 then break end
3596 stanceSway = numLerp(prevStanceSway, 0.5, Sine(X))
3597 if X == 90 then break end
3598 end
3599 end)
3600 tweenJoint(ABWeld, CF(0, 0, -0.1), nil, Sine, S.stanceSettings.Speed)
3601 tweenJoint(LLegWeld, legC0.Prone[1], nil, Sine, S.stanceSettings.Speed)
3602 tweenJoint(RLegWeld, legC0.Prone[2], nil, Sine, S.stanceSettings.Speed)
3603 tweenJoint(Root, CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
3604 tweenJoint(headWeld, CF(0, 1, 1) * CFANG(RAD(90), 0, 0), nil, Sine, S.stanceSettings.Speed)
3605 else
3606 ABWeld.C0 = CF(0, 0, -1 / 8)
3607 LLegWeld.C0 = legC0.Prone[1]
3608 RLegWeld.C0 = legC0.Prone[2]
3609 Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
3610 headWeld.C0 = CF(0, 1, 1) * CFANG(RAD(90), 0, 0)
3611 end
3612end
3613
3614function Dive()
3615 onGround = false
3616 local diveDirection = (HRP.CFrame * CFANG(S.diveSettings.Angle, 0, 0)).lookVector * S.walkSpeeds.Sprinting * S.diveSettings.Force
3617 local BF = Instance.new("BodyForce")
3618 BF.force = diveDirection + Vector3.new(0, playerMass * 196.2, 0)
3619 BF.Parent = HRP
3620 --[[spawn(function()
3621 HRP.Velocity = HRP.CFrame.lookVector * 60 + V3(0, 40, 0)
3622 wait(0.1)
3623 HRP.Velocity = HRP.CFrame.lookVector * 70 + V3(0, 30, 0)
3624 wait(0.4)
3625 HRP.Velocity = HRP.CFrame.lookVector * 30 + V3(0, -10, 0)
3626 end)]]
3627 delay(0.05, function()
3628 spawn(function()
3629 while true do
3630 local newRay = Ray.new(HRP.Position, V3(0, -3.1, 0))
3631 local H, _ = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
3632 if H then
3633 onGround = true
3634 break
3635 end
3636 wait()
3637 end
3638 end)
3639 Prone()
3640 wait(0.1)
3641 BF:Destroy()
3642 end)
3643end
3644
3645--------------------[ MOUSE FUNCTIONS ]-----------------------------------------------
3646
3647function onMB1Down()
3648 MB1Down = true
3649 firstShot = true
3650 if fireFunction then
3651 fireFunction()
3652 end
3653end
3654
3655function onMB1Up()
3656 MB1Down = false
3657 lowerSpread()
3658end
3659
3660function onMB2Down()
3661 if S.aimSettings.holdToADS then
3662 if (not AimingIn) and (not Aimed) then
3663 AimingIn = true
3664 aimGun()
3665 AimingIn = false
3666 end
3667 else
3668 if Aimed then
3669 unAimGun()
3670 else
3671 aimGun()
3672 end
3673 end
3674end
3675
3676function onMB2Up()
3677 if S.aimSettings.holdToADS then
3678 if (not AimingOut) and Aimed then
3679 AimingOut = true
3680 unAimGun()
3681 AimingOut = false
3682 end
3683 end
3684end
3685
3686function onScrollUp()
3687 local newAimSensitivity = aimSensitivity + S.sensitivitySettings.Increment
3688 aimSensitivity = (
3689 newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
3690 newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
3691 newAimSensitivity
3692 )
3693 mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
3694
3695 Sens.Text = "S: "..aimSensitivity
3696 if mainGUI:IsDescendantOf(game) then
3697 Sens.Visible = true
3698 local t0 = tick()
3699 lastSensUpdate = t0
3700
3701 wait(0.3)
3702
3703 if lastSensUpdate <= t0 then
3704 Sens.Visible = true
3705 end
3706 end
3707end
3708
3709function onScrollDown()
3710 local newAimSensitivity = aimSensitivity - S.sensitivitySettings.Increment
3711 aimSensitivity = (
3712 newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
3713 newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
3714 newAimSensitivity
3715 )
3716 mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
3717
3718 Sens.Text = "S: "..aimSensitivity
3719 if mainGUI:IsDescendantOf(game) then
3720 Sens.Visible = true
3721 local t0 = tick()
3722 lastSensUpdate = t0
3723
3724 wait(0.3)
3725
3726 if lastSensUpdate <= t0 then
3727 Sens.Visible = true
3728 end
3729 end
3730end
3731
3732--------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
3733
3734function keyDown(K)
3735 local Key = string.lower(K)
3736
3737 if Key == S.Keys.lowerStance and S.canChangeStance then
3738 if (not Running) then
3739 if Stance == 0 then
3740 if S.stanceSettings.Stances.Crouch then
3741 Crouch()
3742 elseif S.stanceSettings.Stances.Prone then
3743 Prone()
3744 end
3745 elseif Stance == 1 then
3746 if S.stanceSettings.Stances.Prone then
3747 Prone()
3748 end
3749 end
3750 elseif S.dolphinDive then
3751 wait()
3752 if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and (not UIS:IsKeyDown("Space")) and runReady then
3753 local tempConnection = Humanoid.Changed:connect(function()
3754 Humanoid.Jump = false
3755 end)
3756 runReady = false
3757 Dive()
3758 Running = false
3759 wait(S.diveSettings.rechargeTime)
3760 tempConnection:disconnect()
3761 runReady = true
3762 end
3763 end
3764 end
3765
3766 if Key == S.Keys.raiseStance and S.canChangeStance then
3767 if (not Running) then
3768 if Stance == 2 then
3769 if S.stanceSettings.Stances.Crouch then
3770 Crouch()
3771 else
3772 Stand()
3773 end
3774 elseif Stance == 1 then
3775 Stand()
3776 end
3777 end
3778 end
3779
3780 if Key == S.Keys.ADS then
3781 if S.aimSettings.holdToADS then
3782 if (not AimingIn) and (not Aimed) then
3783 AimingIn = true
3784 aimGun()
3785 AimingIn = false
3786 end
3787 else
3788 if Aimed then
3789 unAimGun()
3790 else
3791 aimGun()
3792 end
3793 end
3794 end
3795
3796 if Key == S.Keys.selectFire and S.selectFire then
3797 if canSelectFire then
3798 canSelectFire = false
3799 rawFireMode = rawFireMode + 1
3800 modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
3801 if modeGUI.Text == "AUTO" then
3802 fireFunction = autoFire
3803 elseif modeGUI.Text == "BURST" then
3804 fireFunction = burstFire
3805 elseif modeGUI.Text == "SEMI" then
3806 fireFunction = semiFire
3807 else
3808 fireFunction = nil
3809 end
3810 local speedAlpha = S.selectFireSettings.animSpeed / 0.6
3811 if S.selectFireSettings.GUI then
3812 spawn(function()
3813 fireSelect.Visible = true
3814 local prevRawFireMode = rawFireMode
3815 local Increment = 1.5 / (speedAlpha * 0.25)
3816 local X = 0
3817 wait(speedAlpha * 0.1)
3818 while true do
3819 RS.RenderStepped:wait()
3820 local newX = X + Increment
3821 X = (newX > 90 and 90 or newX)
3822 if prevRawFireMode ~= rawFireMode then break end
3823 updateModeLabels(rawFireMode - 1, rawFireMode, X)
3824 if X == 90 then break end
3825 end
3826 wait(speedAlpha * 0.25)
3827 fireSelect.Visible = false
3828 end)
3829 end
3830 if S.selectFireSettings.Animation and (not Aimed) and (not isRunning) and (not isCrawling) then
3831 spawn(function()
3832 local sequenceTable = {
3833 function()
3834 tweenJoint(RWeld2, nil, CFANG(0, RAD(5), 0), Sine, speedAlpha * 0.15)
3835 tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-7), 0, RAD(-65)), Linear, speedAlpha * 0.15)
3836 wait(speedAlpha * 0.2)
3837 end;
3838
3839 function()
3840 tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-10), 0, RAD(-65)), Linear, speedAlpha * 0.1)
3841 wait(speedAlpha * 0.2)
3842 end;
3843
3844 function()
3845 tweenJoint(RWeld2, nil, CF(), Sine, speedAlpha * 0.2)
3846 tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, speedAlpha * 0.2)
3847 wait(speedAlpha * 0.2)
3848 end;
3849 }
3850
3851 for _, F in pairs(sequenceTable) do
3852 if Aimed or isRunning or isCrawling or Reloading then
3853 break
3854 end
3855 F()
3856 end
3857 end)
3858 end
3859 if S.selectFireSettings.Animation or S.selectFireSettings.GUI then
3860 wait(S.selectFireSettings.animSpeed)
3861 end
3862 canSelectFire = true
3863 end
3864 end
3865
3866 if Key == S.Keys.Reload then
3867 if (not Reloading) and (not isCrawling) then
3868 Reload()
3869 end
3870 end
3871
3872 if Key == S.Keys.Sprint then
3873 runKeyPressed = true
3874 if runReady then
3875 if (not Idling) and Walking and (not Running) and (not Knifing) and (not (Aimed and S.guiScope and S.Keys.Sprint == S.Keys.scopeSteady)) then
3876 monitorStamina()
3877 end
3878 end
3879 end
3880
3881 if Key == S.Keys.scopeSteady then
3882 steadyKeyPressed = true
3883 if Aimed and (not Aiming) then
3884 takingBreath = false
3885 steadyCamera()
3886 end
3887 end
3888
3889 for _, PTable in pairs(Plugins.KeyDown) do
3890 if Key == string.lower(PTable.Key) then
3891 spawn(function()
3892 PTable.Plugin()
3893 end)
3894 end
3895 end
3896end
3897
3898function keyUp(K)
3899 local Key = string.lower(K)
3900
3901 if Key == S.Keys.ADS then
3902 if S.aimSettings.holdToADS then
3903 if (not AimingOut) and Aimed then
3904 AimingOut = true
3905 unAimGun()
3906 AimingOut = false
3907 end
3908 end
3909 end
3910
3911 if Key == S.Keys.Sprint then
3912 runKeyPressed = false
3913 Running = false
3914 if (not chargingStamina) then
3915 rechargeStamina()
3916 end
3917 end
3918
3919 if Key == S.Keys.scopeSteady then
3920 steadyKeyPressed = false
3921 end
3922
3923 for _, PTable in pairs(Plugins.KeyUp) do
3924 if Key == string.lower(PTable.Key) then
3925 spawn(function()
3926 PTable.Plugin()
3927 end)
3928 end
3929 end
3930end
3931
3932--------------------[ END FUNCTIONS ]-------------------------------------------------
3933
3934--------------------------------------------------------------------------------------
3935--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
3936--------------------------------------------------------------------------------------
3937
3938local function updateAnimVars()
3939 wait()
3940 Forward = (UIS:IsKeyDown("W") or UIS:IsKeyDown("Up"))
3941 Backward = (UIS:IsKeyDown("S") or UIS:IsKeyDown("Down"))
3942 local Right = UIS:IsKeyDown("D")
3943 local Left = UIS:IsKeyDown("A")
3944
3945 local walkingForward = (Forward and (not Backward))
3946 local walkingBackward = ((not Forward) and Backward)
3947 local walkingRight = (Right and (not Left))
3948 local walkingLeft = ((not Right) and Left)
3949
3950 if (Forward or Backward or Right or Left) then
3951 Walking, Idling = true, false
3952 if (not Running) and (not Aimed) then
3953 spreadMotion = "Moving"
3954 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3955 end
3956 elseif (not (Forward and Backward and Right and Left)) then
3957 Walking, Idling = false, true
3958 if (not Aimed) then
3959 spreadMotion = "Idling"
3960 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
3961 end
3962 end
3963
3964 local newArmTilt = (
3965 ((walkingForward or walkingBackward) and walkingRight) and 2.5 or
3966 ((walkingForward or walkingBackward) and walkingLeft) and -2.5 or
3967 ((not (walkingForward and walkingBackward)) and walkingRight) and 5 or
3968 ((not (walkingForward and walkingBackward)) and walkingLeft) and -5 or 0
3969 )
3970 local newMoveAng = (
3971 (walkingForward and (not (walkingRight or walkingLeft))) and 0 or
3972 (walkingForward and walkingRight) and RAD(-45) or
3973 ((not (walkingForward or walkingBackward)) and walkingRight) and RAD(-90) or
3974 (walkingBackward and walkingRight) and RAD(-135) or
3975 (walkingBackward and (not (walkingRight or walkingLeft))) and (moveAng < 0 and RAD(-180) or RAD(180)) or
3976 (walkingBackward and walkingLeft) and RAD(135) or
3977 ((not (walkingForward or walkingBackward)) and walkingLeft) and RAD(90) or
3978 (walkingForward and walkingLeft) and RAD(45) or 0
3979 )
3980
3981 local newAnimCode = math.random(-1e9, 1e9)
3982 animCode = newAnimCode
3983 local startTilt = armTilt
3984 local startAng = (ABS(moveAng) == RAD(180)) and (newMoveAng > 0 and RAD(180) or RAD(-180)) or moveAng
3985 local Increment = (startTilt == newArmTilt and 1.5 / 0.7 or 1.5 / (0.35 * ABS(startTilt - newArmTilt) / 5))
3986 local X = 0
3987 while true do
3988 RS.RenderStepped:wait()
3989 local newX = X + Increment
3990 X = (newX > 90 and 90 or newX)
3991 if animCode ~= newAnimCode then break end
3992 armTilt = numLerp(startTilt, newArmTilt, Sine(X))
3993 moveAng = numLerp(startAng, newMoveAng, Sine(X))
3994 if X == 90 then break end
3995 end
3996end
3997
3998M2.KeyDown:connect(updateAnimVars)
3999M2.KeyUp:connect(updateAnimVars)
4000updateAnimVars()
4001
4002--------------------------------------------------------------------------------------
4003--------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
4004--------------------------------------------------------------------------------------
4005
4006function onEquipped()
4007 wait()
4008 if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Char then
4009 Selected = true
4010 breakReload = false
4011 equipAnimPlaying = true
4012
4013 math.randomseed(tick()) --This sets a new seed for the random function each time you select the gun
4014
4015 --------------------[ FAILSAFE RESETING ]-------------------------------------
4016
4017 for _, GM in pairs(ignoreModel:GetChildren()) do
4018 if GM.Name == "gunIgnore_"..Player.Name then
4019 GM:Destroy()
4020 end
4021 end
4022
4023 for _, c in pairs(Connections) do
4024 c:disconnect()
4025 end
4026
4027 Connections = {}
4028
4029 --------------------[ REMOTE GUN SETUP ]--------------------------------------
4030
4031 --[[local Vars = {
4032 ignoreModel = ignoreModel;
4033 Humanoid = Humanoid;
4034 Shoulders = Shoulders;
4035 Torso = Torso;
4036 Head = Head;
4037 armC0 = armC0;
4038 leftArmC1 = S.equipSettings.leftArmC1;
4039 rightArmC1 = S.equipSettings.rightArmC1;
4040 LArm = LArm;
4041 RArm = RArm;
4042 gunParts = gunParts;
4043 Handle = Handle;
4044 }
4045 gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, gunParts2 = gunSetup:InvokeServer(Vars)]]
4046
4047 --------------------[ CREATING IGNORE MODELS ]--------------------------------
4048
4049 gunIgnore = Instance.new("Model")
4050 gunIgnore.Name = "gunIgnore_"..Player.Name
4051 gunIgnore.Parent = ignoreModel
4052
4053 --------------------[ MODIFYING THE PLAYER ]----------------------------------
4054
4055 Player.CameraMode = Enum.CameraMode.LockFirstPerson
4056 Cam.CameraType = Enum.CameraType.Scriptable
4057 Cam.FieldOfView = 80
4058 UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
4059 UIS.MouseIconEnabled = false
4060
4061 local initialX, initialY = getYawPitch(Cam.CoordinateFrame)
4062 camAng = -VEC2(initialX, initialY)
4063
4064 mainGUI.Parent = Player.PlayerGui
4065
4066 setUpGUI()
4067 updateHealth()
4068
4069 if S.selectFire then
4070 local currentMode = Modes[((rawFireMode - 1) % numModes) + 1]
4071 if currentMode == "AUTO" then
4072 fireFunction = autoFire
4073 elseif currentMode == "BURST" then
4074 fireFunction = burstFire
4075 elseif currentMode == "SEMI" then
4076 fireFunction = semiFire
4077 else
4078 fireFunction = nil
4079 end
4080 else
4081 if S.gunType.Semi then
4082 fireFunction = semiFire
4083 elseif S.gunType.Auto then
4084 fireFunction = autoFire
4085 elseif S.gunType.Burst then
4086 fireFunction = burstFire
4087 else
4088 fireFunction = nil
4089 end
4090 end
4091
4092 changePlayerTrans(Char, 1)
4093
4094 Humanoid.AutoRotate = false
4095
4096 Shoulders.Right.Part1 = nil
4097 Shoulders.Left.Part1 = nil
4098
4099 playerFolder = Instance.new("Model")
4100 playerFolder.Name = "playerFolder"
4101 playerFolder.Parent = gunIgnore
4102
4103 local headBase = Instance.new("Part")
4104 headBase.Transparency = 1
4105 headBase.Name = "headBase"
4106 headBase.CanCollide = false
4107 headBase.FormFactor = Enum.FormFactor.Custom
4108 headBase.Size = V3(0.2, 0.2, 0.2)
4109 headBase.BottomSurface = Enum.SurfaceType.Smooth
4110 headBase.TopSurface = Enum.SurfaceType.Smooth
4111 headBase.Parent = playerFolder
4112
4113 headWeld = Instance.new("Weld")
4114 headWeld.Part0 = Torso
4115 headWeld.Part1 = headBase
4116 headWeld.C0 = CF(0, 1.5, 0)
4117 headWeld.Parent = Torso
4118
4119 headWeld2 = Instance.new("Weld")
4120 headWeld2.Part0 = headBase
4121 headWeld2.Part1 = Head
4122 headWeld2.Parent = headBase
4123
4124 neckClone = Neck:Clone()
4125
4126 --[[local stanceBase = Instance.new("Part")
4127 stanceBase.Transparency = 1
4128 stanceBase.Name = "stanceBase"
4129 stanceBase.CanCollide = false
4130 stanceBase.FormFactor = Enum.FormFactor.Custom
4131 stanceBase.Size = V3(0.2, 0.2, 0.2)
4132 stanceBase.BottomSurface = Enum.SurfaceType.Smooth
4133 stanceBase.TopSurface = Enum.SurfaceType.Smooth
4134 stanceBase.Parent = playerFolder
4135
4136 stanceWeld = Instance.new("Weld")
4137 stanceWeld.Part0 = stanceBase
4138 stanceWeld.Part1 = Torso
4139 stanceWeld.Parent = stanceBase]]
4140
4141 local animBase = Instance.new("Part")
4142 animBase.Transparency = 1
4143 animBase.Name = "animBase"
4144 animBase.CanCollide = false
4145 animBase.FormFactor = Enum.FormFactor.Custom
4146 animBase.Size = V3(0.2, 0.2, 0.2)
4147 animBase.BottomSurface = Enum.SurfaceType.Smooth
4148 animBase.TopSurface = Enum.SurfaceType.Smooth
4149 animBase.Parent = playerFolder
4150
4151 animWeld = Instance.new("Weld")
4152 animWeld.Part0 = animBase
4153 animWeld.Part1 = headBase
4154 animWeld.Parent = animBase
4155
4156 local ArmBase = Instance.new("Part")
4157 ArmBase.Transparency = 1
4158 ArmBase.Name = "ArmBase"
4159 ArmBase.CanCollide = false
4160 ArmBase.FormFactor = Enum.FormFactor.Custom
4161 ArmBase.Size = V3(0.2, 0.2, 0.2)
4162 ArmBase.BottomSurface = Enum.SurfaceType.Smooth
4163 ArmBase.TopSurface = Enum.SurfaceType.Smooth
4164 ArmBase.Parent = playerFolder
4165
4166 ABWeld = Instance.new("Weld")
4167 ABWeld.Part0 = ArmBase
4168 ABWeld.Part1 = animBase
4169 ABWeld.Parent = ArmBase
4170
4171 local LArmBase = Instance.new("Part")
4172 LArmBase.Transparency = 1
4173 LArmBase.Name = "LArmBase"
4174 LArmBase.CanCollide = false
4175 LArmBase.FormFactor = Enum.FormFactor.Custom
4176 LArmBase.Size = V3(0.2, 0.2, 0.2)
4177 LArmBase.BottomSurface = Enum.SurfaceType.Smooth
4178 LArmBase.TopSurface = Enum.SurfaceType.Smooth
4179 LArmBase.Parent = playerFolder
4180
4181 local RArmBase = Instance.new("Part")
4182 RArmBase.Transparency = 1
4183 RArmBase.Name = "RArmBase"
4184 RArmBase.CanCollide = false
4185 RArmBase.FormFactor = Enum.FormFactor.Custom
4186 RArmBase.Size = V3(0.2, 0.2, 0.2)
4187 RArmBase.BottomSurface = Enum.SurfaceType.Smooth
4188 RArmBase.TopSurface = Enum.SurfaceType.Smooth
4189 RArmBase.Parent = playerFolder
4190
4191 LWeld = Instance.new("Weld")
4192 LWeld.Name = "LWeld"
4193 LWeld.Part0 = ArmBase
4194 LWeld.Part1 = LArmBase
4195 LWeld.C0 = armC0[1]
4196 LWeld.C1 = S.equipSettings.leftArmC1
4197 LWeld.Parent = ArmBase
4198
4199 RWeld = Instance.new("Weld")
4200 RWeld.Name = "RWeld"
4201 RWeld.Part0 = ArmBase
4202 RWeld.Part1 = RArmBase
4203 RWeld.C0 = armC0[2]
4204 RWeld.C1 = S.equipSettings.rightArmC1
4205 RWeld.Parent = ArmBase
4206
4207 LWeld2 = Instance.new("Weld")
4208 LWeld2.Name = "LWeld"
4209 LWeld2.Part0 = LArmBase
4210 LWeld2.Part1 = LArm
4211 LWeld2.Parent = LArmBase
4212
4213 RWeld2 = Instance.new("Weld")
4214 RWeld2.Name = "RWeld"
4215 RWeld2.Part0 = RArmBase
4216 RWeld2.Part1 = RArm
4217 RWeld2.Parent = RArmBase
4218
4219 LLegWeld = Instance.new("Weld")
4220 LLegWeld.Name = "LLegWeld"
4221 LLegWeld.Part0 = Torso
4222 LLegWeld.Part1 = nil
4223 LLegWeld.C0 = CF(-0.5, -2, 0)
4224 LLegWeld.Parent = Torso
4225
4226 RLegWeld = Instance.new("Weld")
4227 RLegWeld.Name = "RLegWeld"
4228 RLegWeld.Part0 = Torso
4229 RLegWeld.Part1 = nil
4230 RLegWeld.C0 = CF(0.5, -2, 0)
4231 RLegWeld.Parent = Torso
4232
4233 if S.playerArms then
4234 armModel = Instance.new("Model", workspace.FilteringEnabled and playerFolder or Cam)
4235
4236 fakeLArm = LArm:Clone()
4237 fakeLArm.Parent = armModel
4238 fakeLArm.Transparency = S.fakeArmSettings.Transparency
4239 fakeLArm.CanCollide = false
4240 fakeLArm.Size = S.fakeArmSettings.armSize
4241 fakeLArm:BreakJoints()
4242
4243 --LArm.Transparency = 1
4244
4245 local fakeLWeld = Instance.new("Weld")
4246 fakeLWeld.Part0 = fakeLArm
4247 fakeLWeld.Part1 = LArm
4248 fakeLWeld.Parent = fakeLArm
4249
4250 fakeRArm = RArm:Clone()
4251 fakeRArm.Parent = armModel
4252 fakeRArm.Transparency = S.fakeArmSettings.Transparency
4253 fakeRArm.CanCollide = false
4254 fakeRArm.Size = S.fakeArmSettings.armSize
4255 fakeRArm:BreakJoints()
4256
4257 --RArm.Transparency = 1
4258
4259 local fakeRWeld = Instance.new("Weld")
4260 fakeRWeld.Part0 = fakeRArm
4261 fakeRWeld.Part1 = RArm
4262 fakeRWeld.Parent = fakeRArm
4263
4264 Instance.new("Humanoid", armModel)
4265
4266 if S.fakeArmSettings.characterMeshes then
4267 for _,Obj in pairs(Char:GetChildren()) do
4268 if Obj:IsA("CharacterMesh") then
4269 Obj:Clone().Parent = armModel
4270 end
4271 end
4272 end
4273 for _,Obj in pairs(Char:GetChildren()) do
4274 if Obj:IsA("Shirt") then
4275 Obj:Clone().Parent = armModel
4276 end
4277 end
4278 else
4279 armTable = createArms()
4280 if workspace.FilteringEnabled then
4281 armTable[1].Model.Parent = playerFolder
4282 armTable[2].Model.Parent = playerFolder
4283 else
4284 armTable[1].Model.Parent = Cam--playerFolder
4285 armTable[2].Model.Parent = Cam--playerFolder
4286 end
4287
4288 fakeLArm = armTable[1].armPart
4289
4290 --LArm.Transparency = 1
4291
4292 local fakeLWeld = Instance.new("Weld")
4293 fakeLWeld.Part0 = fakeLArm
4294 fakeLWeld.Part1 = LArm
4295 fakeLWeld.Parent = fakeLArm
4296
4297 fakeRArm = armTable[2].armPart
4298
4299 --RArm.Transparency = 1
4300
4301 local fakeRWeld = Instance.new("Weld")
4302 fakeRWeld.Part0 = fakeRArm
4303 fakeRWeld.Part1 = RArm
4304 fakeRWeld.Parent = fakeRArm
4305 end
4306
4307 --------------------[ MODIFYING THE GUN ]-------------------------------------
4308
4309 for _, Tab in pairs(gunParts) do
4310 local Weld = Instance.new("Weld")
4311 Weld.Name = "MainWeld"
4312 Weld.Part0 = Handle
4313 Weld.Part1 = Tab.Obj
4314 Weld.C0 = Tab.Obj.weldCF.Value
4315 Weld.Parent = Handle
4316 Tab.Weld = Weld
4317 end
4318
4319 Grip = RArm:WaitForChild("RightGrip")
4320
4321 local handleCF = Torso.CFrame * CF(0, 0.5, 0) * armC0[2] * S.aimedC1.rightArm:inverse() * Grip.C0
4322 local handleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
4323 aimedGripCF = ((Torso.CFrame * CF(headOffset.X, headOffset.Y, 0)) * handleOffset):toObjectSpace(handleCF)
4324
4325 Grip.C1 = S.equipSettings.GripC1
4326
4327 --------------------[ RUNNING PLUGINS ]---------------------------------------
4328
4329 for _, Plugin in pairs(Plugins.OnEquipped) do
4330 spawn(function()
4331 Plugin()
4332 end)
4333 end
4334
4335 --------------------[ GETTING PLAYER MASS ]-----------------------------------
4336
4337 local connectedParts = HRP:GetConnectedParts(true)
4338 for _, v in pairs(connectedParts) do
4339 if v:IsA("BasePart") then
4340 playerMass = playerMass + v:GetMass()
4341 end
4342 end
4343
4344 --------------------[ CONNECTIONS ]-------------------------------------------
4345
4346 INSERT(Connections, Humanoid.Died:connect(function()
4347 onUnequipped(true)
4348 end))
4349
4350 INSERT(Connections, Humanoid.Jumping:connect(function()
4351 if Stance ~= 0 then
4352 Stand()
4353 end
4354 end))
4355
4356 INSERT(Connections, Humanoid.StateChanged:connect(onHumanoidStateChanged))
4357
4358 INSERT(Connections, Humanoid.HealthChanged:connect(updateHealth))
4359
4360 INSERT(Connections, M2.Button1Down:connect(onMB1Down))
4361
4362 INSERT(Connections, M2.Button1Up:connect(onMB1Up))
4363
4364 INSERT(Connections, M2.Button2Down:connect(onMB2Down))
4365
4366 INSERT(Connections, M2.Button2Up:connect(onMB2Up))
4367
4368 INSERT(Connections, M2.KeyDown:connect(keyDown))
4369
4370 INSERT(Connections, M2.KeyUp:connect(keyUp))
4371
4372 if S.sensitivitySettings.scrollToChange then
4373 INSERT(Connections, M2.WheelForward:connect(onScrollUp))
4374 INSERT(Connections, M2.WheelBackward:connect(onScrollDown))
4375 end
4376
4377 if S.AutoKnife then
4378 INSERT(Connections, RS.Stepped:connect(function()
4379 local H, P = AdvRayCast(Head.CFrame.p, Head.CFrame.lookVector, S.AutoKnifeDist, nil)
4380 if H then
4381 local HitHuman = findFirstClass(H.Parent, "Humanoid")
4382 if HitHuman and isEnemy(HitHuman) and HitHuman.Health ~= 0 then
4383 Knife()
4384 end
4385 end
4386 end))
4387 end
4388
4389 INSERT(Connections, UIS.InputChanged:connect(function(inputObj)
4390 if inputObj.UserInputType == Enum.UserInputType.MouseMovement then
4391 local rawCamAng = camAng - (VEC2(RAD(inputObj.Delta.x), RAD(inputObj.Delta.y)) * mouseSensitivity * 0.25)
4392 camAng = VEC2(rawCamAng.x, (rawCamAng.y > RAD(80) and RAD(80) or rawCamAng.y < RAD(-80) and RAD(-80) or rawCamAng.y))
4393
4394 desiredXOffset = math.min(math.max(inputObj.Delta.x, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
4395 desiredYOffset = math.min(math.max(inputObj.Delta.y, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
4396 end
4397 end))
4398
4399 INSERT(Connections, M2.Idle:connect(function(inputObj)
4400 desiredXOffset = 0
4401 desiredYOffset = 0
4402 end))
4403
4404 INSERT(Connections, RS.Stepped:connect(function()
4405 if tick() - lastBeat > (Humanoid.Health / 75) then
4406 lastBeat = tick()
4407 HUD.Health.Tray.Beat:TweenPosition(
4408 UDim2.new(0, -21, 0, 0),
4409 Enum.EasingDirection.Out,
4410 Enum.EasingStyle.Linear,
4411 0.7 - ((100 - Humanoid.Health) / 400),
4412 false,
4413 function()
4414 HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
4415 end
4416 )
4417 end
4418 end))
4419
4420 INSERT(Connections, RS.RenderStepped:connect(function()
4421 --Main animation
4422 local animC0, animC1 = getAnimCF()
4423 animWeld.C0 = animC0
4424 animWeld.C1 = animC1
4425
4426 --Camera updating
4427 renderCamera()
4428 end))
4429
4430 --------------------[ ANIMATE GUN ]-------------------------------------------
4431
4432 tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, S.equipSettings.Time)
4433 tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, S.equipSettings.Time)
4434 tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.equipSettings.Time)
4435 spawn(function()
4436 local T = tick()
4437 while true do
4438 if tick() - T > S.equipSettings.Time then break end
4439 if (not Selected) then break end
4440 wait()
4441 end
4442 equipAnimPlaying = false
4443 end)
4444
4445 Animate()
4446 end
4447end
4448
4449function onUnequipped(deleteTool)
4450 if Selected then
4451 Selected = false
4452
4453 breakReload = true
4454
4455 --------------------[ RUNNING PLUGINS ]---------------------------------------
4456
4457 for _, Plugin in pairs(Plugins.OnUnEquipped) do
4458 spawn(function()
4459 Plugin()
4460 end)
4461 end
4462
4463 --------------------[ MODIFYING THE PLAYER ]----------------------------------
4464
4465 Cam.FieldOfView = 70
4466 Cam.CameraType = Enum.CameraType.Custom
4467
4468 UIS.MouseBehavior = Enum.MouseBehavior.Default
4469 UIS.MouseIconEnabled = true
4470
4471 Player.CameraMode = Enum.CameraMode.Classic
4472
4473 if armTable then
4474 armTable[1].Model:Destroy()
4475 armTable[2].Model:Destroy()
4476 elseif armModel then
4477 armModel:Destroy()
4478 end
4479
4480 LLegWeld:Destroy()
4481 RLegWeld:Destroy()
4482
4483 changePlayerTrans(Char, 0)
4484
4485 mainGUI.Parent = script
4486
4487 Shoulders.Right.Part1 = RArm
4488 Shoulders.Left.Part1 = LArm
4489
4490 neckClone.Parent = Torso
4491 headWeld:Destroy()
4492
4493 Humanoid.WalkSpeed = 16
4494 Humanoid.AutoRotate = true
4495
4496 --------------------[ RESETING THE TOOL ]-------------------------------------
4497
4498 gunIgnore:Destroy()
4499
4500 mouseSensitivity = S.sensitivitySettings.Default
4501
4502 MB1Down = false
4503
4504 playerMass = 0
4505
4506 Aimed = false
4507
4508 camOffsets = {
4509 guiScope = {
4510 Rot = V3();
4511 };
4512 Reload = {
4513 Rot = V3();
4514 Code = nil;
4515 };
4516 Recoil = {
4517 Rot = V3();
4518 Code = nil;
4519 };
4520 }
4521
4522 recoilAnim = {
4523 Pos = V3();
4524 Rot = V3();
4525 Code = nil;
4526 }
4527
4528 --Setting the aim variables to unaimed
4529 spreadZoom = "unAimed"
4530 scopeMain.Visible = false
4531 scopeSteady.Visible = false
4532 aimAlpha = 0
4533 aimHeadOffset = 0
4534 jumpAnimMultiplier = 1
4535 translationDivisor = 7
4536 rotationMultiplier = S.momentumSettings.Amplitude.unAimed
4537 armTiltMultiplier = 1
4538 Scope.BackgroundTransparency = 1
4539 if S.guiScope then
4540 spawn(function()
4541 for _, Obj in pairs(Gun:GetChildren()) do
4542 if Obj:IsA("BasePart") then
4543 Obj.LocalTransparencyModifier = 0
4544 end
4545 end
4546 end)
4547 end
4548
4549 onGround = true
4550
4551 for _, Tab in pairs(gunParts) do
4552 Tab.Weld:Destroy()
4553 Tab.Weld = nil
4554 end
4555
4556 for _,c in pairs(Connections) do
4557 c:disconnect()
4558 end
4559
4560 Connections = {}
4561
4562 if deleteTool then
4563 Cam:ClearAllChildren()
4564 Gun:Destroy()
4565 end
4566
4567 wait() --This is here in case you dolphin dived and deselected the tool instantly
4568
4569 if S.stanceSettings.standOnDeselect and Stance ~= 0 then
4570 crawlCamRot = 0
4571 isCrawling = false
4572 stanceSway = 1
4573 spreadStance = "Stand"
4574 Stand(true)
4575 end
4576 baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
4577 end
4578end
4579
4580Gun.Equipped:connect(onEquipped)
4581Gun.Unequipped:connect(function() onUnequipped(false) end)
4582
4583--------------------------------------------------------------------------------------
4584--------------------[ END PROGRAM ]---------------------------------------------------
4585--------------------------------------------------------------------------------------
4586 end))
4587 IntValue36.Name = "ignoreCode"
4588IntValue36.Parent = LocalScript35
4589Folder37.Name = "Server_Scripts"
4590Folder37.Parent = LocalScript35
4591ModuleScript38.Name = "Spring"
4592ModuleScript38.Parent = LocalScript35
4593table.insert(cors,sandbox(ModuleScript38,function()
4594local Spring = {}
4595
4596function Spring.new(Initial)
4597 local t0 = tick()
4598 local p0 = Initial or 0
4599 local v0 = Initial and Vector3.new() or 0
4600 local t = Initial or 0
4601 local d = 1
4602 local s = 1
4603
4604 local function positionVelocity(Tick)
4605 local x = Tick - t0
4606 local c0 = p0 - t
4607 if s == 0 then
4608 return p0, 0
4609 elseif d < 1 then
4610 local c = math.sqrt(1 - d ^ 2)
4611 local c1 = (v0 / s + d * c0) / c
4612 local co = math.cos(c * s * x)
4613 local si = math.sin(c * s * x)
4614 local e = math.exp(d * s * x)
4615 local p = t + (c0 * co + c1 * si) / e
4616 local v = s * ((c * c1 - d * c0) * co - (c * c0 + d * c1) * si) / e
4617 return p, v
4618 else
4619 local c1 = v0 / s + c0
4620 local e = math.exp(s * x)
4621 local p = t + (c0 + c1 * s * x) / e
4622 local v = s * (c1 - c0 - c1 * s * x) / e
4623 return p, v
4624 end
4625 end
4626
4627 return setmetatable(
4628 {
4629 accelerate = function(_, acceleration)
4630 local T = tick()
4631 local p, v = positionVelocity(T)
4632 p0 = p
4633 v0 = v + acceleration
4634 t0 = T
4635 end;
4636 },
4637 {
4638 __index = function(_, index)
4639 if index == "value" or index == "position" or index == "p" then
4640 local p, v = positionVelocity(tick())
4641 return p
4642 elseif index == "velocity" or index == "v" then
4643 local p, v = positionVelocity(tick())
4644 return v
4645 elseif index == "acceleration" or index == "a" then
4646 local x = tick() - t0
4647 local c0 = p0 - t
4648 if s == 0 then
4649 return 0
4650 elseif d < 1 then
4651 local c = math.sqrt(1 - d ^ 2)
4652 local c1 = (v0 / s + d * c0) / c
4653 local cs = (c0 * d ^ 2 - 2 * c * d * c1 - c0 * c ^ 2) * math.cos(c * s * x)
4654 local sn = (c1 * d ^ 2 + 2 * c * d * c0 - c1 * c ^ 2) * math.sin(c * s * x)
4655 return s ^ 2 *(cs + sn) / math.exp(d * s * x)
4656 else
4657 local c1 = v0 / s + c0
4658 return s ^ 2 * (c0 - 2 * c1 + c1 * s * x) / math.exp(s * x)
4659 end
4660 elseif index == "target" or index == "t" then
4661 return t
4662 elseif index == "damper" or index == "d" then
4663 return d
4664 elseif index == "speed" or index == "s" then
4665 return s
4666 elseif index == "magnitude" or index == "m" then
4667 local p, v = positionVelocity(tick())
4668 return p.magnitude
4669 else
4670 error(index.." is not a valid member of spring", 0)
4671 end
4672 end;
4673
4674 __newindex = function(_, index, value)
4675 local T = tick()
4676 if index == "value" or index == "position" or index == "p" then
4677 local p, v = positionVelocity(T)
4678 p0, v0 = value, v
4679 elseif index == "velocity" or index == "v" then
4680 local p, v = positionVelocity(T)
4681 p0, v0 = p, value
4682 elseif index == "acceleration" or index == "a" then
4683 local p, v = positionVelocity(T)
4684 p0, v0 = p, v + value
4685 elseif index == "target" or index == "t" then
4686 p0, v0 = positionVelocity(T)
4687 t = value
4688 elseif index == "damper" or index == "d" then
4689 p0, v0 = positionVelocity(T)
4690 d = value < 0 and 0 or value < 1 and value or 1
4691 elseif index == "speed" or index == "s" then
4692 p0, v0 = positionVelocity(T)
4693 s = value < 0 and 0 or value
4694 else
4695 error(index.." is not a valid member of spring", 0)
4696 end
4697 t0 = T
4698 end;
4699 }
4700 )
4701end
4702
4703return Spring
4704end))
4705ModuleScript39.Name = "Particle"
4706ModuleScript39.Parent = LocalScript35
4707table.insert(cors,sandbox(ModuleScript39,function()
4708---------------------------------------------------------------------------------------------------------
4709--[[
4710
4711 AUTHOR: TurboFusion
4712 DATE CREATED: 4/8/16
4713
4714 DESCRIPTION: This is a module that creates gui particles which simulates physical parts
4715
4716 function Particle.new(Prop)
4717
4718 ARGUMENT: Table {
4719 Table rayIgnore; --This table contains objects that the visiblity checking ray should ignore (DEFAULT: {})
4720 Color3 Color; --This color3 value is what color the particle will be (DEFAULT: Color3.new(1, 1, 1))
4721 float Length; --This float value is how long the particle will be in world space (DEFAULT: 1)
4722 float Width; --This float value is how wide the particle will be in world space (DEFAULT: 1)
4723 Vector3 p0; --This Vector3 value is the initial position of the particle (Must exist)
4724 Vector3 v0; --This Vector3 value is the initial velocity of the particle (Must exist)
4725 Vector3 a0; --This Vector3 value is the initial acceleration of the particle (Must exist)
4726 }
4727
4728 RETURNS: Metatable
4729
4730 EDITABLE PROPERTIES:
4731 Particle.t = float Time --Sets a time value in seconds which is used to figure out where to render the particle (t=0 will be initial conditions)
4732
4733 READ-ONLY PROPERTIES:
4734 Particle.p or Particle.position --Returns a world position of the particle
4735 Particle.v or Particle.velocity --Returns a world velocity of the particle
4736 Particle.obj or Particle.object --Returns the particle frame itself
4737
4738 METHODS:
4739 Particle:delete() --This method deletes the particle and stops rendering calculations (use this instead of directly destroying the frame itself)
4740
4741 EXAMPLE CODE:
4742 local t = 0
4743 local Particle = Particle.new(
4744 {
4745 Color = Color3.new(1, 1, 0);
4746 Width = 1;
4747 p0 = Vector3.new();
4748 v0 = Vector3.new(0, 100, 100);
4749 a0 = Vector3.new(0, -196.2, 0);
4750 }
4751 )
4752 Particle.obj.Parent = screenGui
4753 while true do
4754 Particle.t = t
4755 t = t + 1/30
4756 wait()
4757 end
4758
4759--]]
4760---------------------------------------------------------------------------------------------------------
4761
4762local Particle = {}
4763
4764function Particle.new(Prop)
4765 ----------[ CONSTANTS ]--------------------
4766
4767 local Cam = workspace.CurrentCamera
4768 local rayIgnore = Prop.rayIgnore or {} --If the property doesn't exist, then set it to it's default
4769 local Color = Prop.Color or Color3.new(1, 1, 1)
4770 local Length = Prop.Length or 1
4771 local Width = Prop.Width or 1
4772 local p0 = Prop.p0 or error("Particle.new requires a p0 (origin position) property!", 0) --Give an error message if you don't this
4773 local v0 = Prop.v0 or error("Particle.new requires a v0 (initial velocity) property!", 0)
4774 local a0 = Prop.a0 or error("Particle.new requires an a0 (initial acceleration) property!", 0)
4775
4776 ----------[ VARIABLES ]--------------------
4777
4778 local Deleted = false
4779 local p = p0 --Set the position, velocity, and acceleration as the intial conditions
4780 local v = v0
4781 local a = a0
4782 local t = 0
4783
4784 ----------[ FUNCTIONS ]--------------------
4785
4786 local function worldWidthToScreenWidth(Width, Depth) --A function I made that gives you a screen width given a world width and depth
4787 local Center = Cam.CoordinateFrame * CFrame.new(0, 0, -Depth)
4788 local wp1 = (Center * CFrame.new(0, Width / 2, 0)).p
4789 local wp2 = (Center * CFrame.new(0, -Width / 2, 0)).p
4790 local sp1 = Cam:WorldToScreenPoint(wp1) --Use the WorldToScreenPoint method of the camera to get the screen width from the world width
4791 local sp2 = Cam:WorldToScreenPoint(wp2)
4792 return (sp1 - sp2).magnitude
4793 end
4794
4795 ----------[ MAIN PROGRAM ]-----------------
4796
4797 local Container = Instance.new("Frame")
4798 Container.BackgroundTransparency = 1
4799 Container.Position = UDim2.new()
4800 Container.Size = UDim2.new()
4801 local Line = Instance.new("Frame")
4802 Line.BackgroundColor3 = Color
4803 Line.BorderSizePixel = 0
4804 Line.Position = UDim2.new()
4805 Line.Size = UDim2.new()
4806 Line.Parent = Container
4807
4808 return setmetatable(
4809 {
4810 delete = function() --This function safely removes the particle
4811 Container:Destroy()
4812 Deleted = true
4813 end
4814 },
4815 {
4816 __index = function(_, Index)
4817 if Index == "p" or Index == "position" then --Return the world position of the particle
4818 return (Deleted and nil or p)
4819 elseif Index == "v" or Index == "velocity" then --Return the world velocity of the particle
4820 return (Deleted and nil or v)
4821 elseif Index == "obj" or Index == "object" then --Return the particle frame itself
4822 return (Deleted and nil or Container)
4823 else
4824 error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is called
4825 end
4826 end;
4827
4828 __newindex = function(_, Index, Value)
4829 if Index == "t" or Index == "time" and (not Deleted) then --Render the particle given a time value
4830 t = Value
4831 p = p0 + (v0 * t) + (0.5 * a0 * t * t) --update the position given the time
4832 v = v0 + (a0 * t) --update the velocity given the time
4833
4834 local testRay1 = Ray.new(Cam.CoordinateFrame.p, (p + (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
4835 local testRay2 = Ray.new(Cam.CoordinateFrame.p, (p - (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
4836 local H1, _ = workspace:FindPartOnRayWithIgnoreList(testRay1, rayIgnore)
4837 local H2, _ = workspace:FindPartOnRayWithIgnoreList(testRay2, rayIgnore)
4838
4839 if H1 and H2 then
4840 Line.Visible = false
4841 else
4842 local face1 = Cam:WorldToScreenPoint(p + (v.unit * Length) / 2) --Get the 2 endpoints of the particle in screen space
4843 local face2 = Cam:WorldToScreenPoint(p - (v.unit * Length) / 2)
4844 local Center, isVisible = Cam:WorldToScreenPoint(p) --Get the center of the particle in screen space
4845
4846 local screenLength = (face1 - face2).magnitude
4847 local screenWidth = worldWidthToScreenWidth(Width, Center.Z)
4848 local Ang = math.atan2(face1.Y - face2.Y, face1.X - face2.X) --Get the angle the particle needs to be at in order to line up
4849
4850 Line.Position = UDim2.new(0, 0, 0, -screenWidth / 2)
4851 Line.Size = UDim2.new(1, 0, 0, screenWidth)
4852 Line.Visible = isVisible --Make the particle invisible if the world point isn't on screen
4853
4854 Container.Position = UDim2.new(
4855 0,
4856 face2.X + (math.cos(Ang) - 1) * screenLength / 2, --Yay trig!
4857 0,
4858 face2.Y + math.sin(Ang) * screenLength / 2
4859 )
4860 Container.Size = UDim2.new(0, screenLength, 0, 0)
4861 Container.Rotation = math.deg(Ang)
4862 end
4863 else
4864 error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is being changed
4865 end
4866 end
4867 }
4868 )
4869end
4870
4871return Particle
4872end))
4873ScreenGui40.Name = "mainGUI"
4874ScreenGui40.Parent = LocalScript35
4875Frame41.Name = "HUD"
4876Frame41.Parent = ScreenGui40
4877Frame41.Position = UDim2.new(1, -160, 1, -140)
4878Frame41.Size = UDim2.new(0, 160, 0, 160)
4879Frame41.BackgroundColor = BrickColor.new("Institutional white")
4880Frame41.BackgroundColor3 = Color3.new(1, 1, 1)
4881Frame41.BackgroundTransparency = 1
4882Frame42.Name = "Ammo"
4883Frame42.Parent = Frame41
4884Frame42.Position = UDim2.new(0, 5, 0, 60)
4885Frame42.Size = UDim2.new(0, 135, 0, 40)
4886Frame42.BackgroundTransparency = 1
4887Frame42.ZIndex = 10
4888TextLabel43.Name = "Slash"
4889TextLabel43.Parent = Frame42
4890TextLabel43.Position = UDim2.new(0, 92, 0, -12)
4891TextLabel43.Visible = false
4892TextLabel43.Size = UDim2.new(0, 0, 0, 45)
4893TextLabel43.BackgroundTransparency = 1
4894TextLabel43.ZIndex = 10
4895TextLabel43.Font = Enum.Font.SciFi
4896TextLabel43.FontSize = Enum.FontSize.Size24
4897TextLabel43.Text = "/"
4898TextLabel43.TextColor = BrickColor.new("Institutional white")
4899TextLabel43.TextColor3 = Color3.new(1, 1, 1)
4900TextLabel43.TextSize = 24
4901TextLabel44.Name = "Stored"
4902TextLabel44.Parent = Frame42
4903TextLabel44.Position = UDim2.new(0, 100, 0, -35)
4904TextLabel44.Visible = false
4905TextLabel44.Size = UDim2.new(1, 0, 0, 85)
4906TextLabel44.BackgroundTransparency = 1
4907TextLabel44.ZIndex = 10
4908TextLabel44.Font = Enum.Font.Code
4909TextLabel44.FontSize = Enum.FontSize.Size28
4910TextLabel44.Text = "999"
4911TextLabel44.TextColor = BrickColor.new("Institutional white")
4912TextLabel44.TextColor3 = Color3.new(1, 1, 1)
4913TextLabel44.TextSize = 25
4914TextLabel44.TextXAlignment = Enum.TextXAlignment.Left
4915TextLabel45.Name = "Clip"
4916TextLabel45.Parent = Frame42
4917TextLabel45.Position = UDim2.new(0, 32, 0, -5)
4918TextLabel45.Size = UDim2.new(0, 85, 1, 0)
4919TextLabel45.BackgroundTransparency = 1
4920TextLabel45.ZIndex = 10
4921TextLabel45.Font = Enum.Font.Code
4922TextLabel45.FontSize = Enum.FontSize.Size48
4923TextLabel45.Text = "999"
4924TextLabel45.TextColor = BrickColor.new("Institutional white")
4925TextLabel45.TextColor3 = Color3.new(1, 1, 1)
4926TextLabel45.TextSize = 48
4927TextLabel45.TextWrap = true
4928TextLabel45.TextWrapped = true
4929Frame46.Name = "Controls"
4930Frame46.Parent = Frame41
4931Frame46.Position = UDim2.new(0, 0, 0, -200)
4932Frame46.Visible = false
4933Frame46.Size = UDim2.new(1, 0, 0, 120)
4934Frame46.BackgroundColor = BrickColor.new("Black")
4935Frame46.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4936Frame46.BackgroundTransparency = 0.30000001192093
4937Frame46.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
4938Frame46.BorderSizePixel = 5
4939Frame46.ZIndex = 10
4940TextLabel47.Name = "Title"
4941TextLabel47.Parent = Frame46
4942TextLabel47.Size = UDim2.new(1, 0, 0, 15)
4943TextLabel47.BackgroundColor = BrickColor.new("Institutional white")
4944TextLabel47.BackgroundColor3 = Color3.new(1, 1, 1)
4945TextLabel47.BackgroundTransparency = 1
4946TextLabel47.ZIndex = 10
4947TextLabel47.Font = Enum.Font.SourceSansBold
4948TextLabel47.FontSize = Enum.FontSize.Size14
4949TextLabel47.Text = "CONTROLS"
4950TextLabel47.TextColor = BrickColor.new("Institutional white")
4951TextLabel47.TextColor3 = Color3.new(1, 1, 1)
4952TextLabel47.TextSize = 14
4953TextLabel48.Name = "Line"
4954TextLabel48.Parent = TextLabel47
4955TextLabel48.Position = UDim2.new(0, 0, 1, 1)
4956TextLabel48.Size = UDim2.new(1, 0, 0, 2)
4957TextLabel48.BackgroundColor = BrickColor.new("New Yeller")
4958TextLabel48.BackgroundColor3 = Color3.new(1, 1, 0)
4959TextLabel48.BorderSizePixel = 0
4960TextLabel48.ZIndex = 10
4961TextLabel48.Font = Enum.Font.SourceSans
4962TextLabel48.FontSize = Enum.FontSize.Size14
4963TextLabel48.Text = ""
4964TextLabel48.TextSize = 14
4965Frame49.Name = "Grenades"
4966Frame49.Parent = Frame41
4967Frame49.Position = UDim2.new(0, 0, 0, 90)
4968Frame49.Visible = false
4969Frame49.Size = UDim2.new(0, 175, 0, 25)
4970Frame49.BackgroundTransparency = 1
4971Frame49.ZIndex = 10
4972Frame50.Name = "Lethals"
4973Frame50.Parent = Frame49
4974Frame50.Size = UDim2.new(0.5, -2, 1, 0)
4975Frame50.BackgroundColor = BrickColor.new("Institutional white")
4976Frame50.BackgroundColor3 = Color3.new(1, 1, 1)
4977Frame50.BorderSizePixel = 0
4978Frame50.ZIndex = 10
4979ImageLabel51.Name = "Icon"
4980ImageLabel51.Parent = Frame50
4981ImageLabel51.Position = UDim2.new(0, 7, 0, 2)
4982ImageLabel51.Size = UDim2.new(0, 21, 0, 21)
4983ImageLabel51.BackgroundColor = BrickColor.new("Institutional white")
4984ImageLabel51.BackgroundColor3 = Color3.new(1, 1, 1)
4985ImageLabel51.BackgroundTransparency = 1
4986ImageLabel51.ZIndex = 10
4987TextLabel52.Name = "Mult"
4988TextLabel52.Parent = Frame50
4989TextLabel52.Position = UDim2.new(0.5, -10, 0, 0)
4990TextLabel52.Size = UDim2.new(0, 20, 1, 0)
4991TextLabel52.BackgroundColor = BrickColor.new("Institutional white")
4992TextLabel52.BackgroundColor3 = Color3.new(1, 1, 1)
4993TextLabel52.BackgroundTransparency = 1
4994TextLabel52.BorderSizePixel = 0
4995TextLabel52.ZIndex = 10
4996TextLabel52.Font = Enum.Font.ArialBold
4997TextLabel52.FontSize = Enum.FontSize.Size18
4998TextLabel52.Text = "X"
4999TextLabel52.TextColor = BrickColor.new("Really black")
5000TextLabel52.TextColor3 = Color3.new(0, 0, 0)
5001TextLabel52.TextSize = 18
5002TextLabel53.Name = "Num"
5003TextLabel53.Parent = Frame50
5004TextLabel53.Position = UDim2.new(1, -7, 0, 0)
5005TextLabel53.Size = UDim2.new(0, 0, 1, 0)
5006TextLabel53.BackgroundColor = BrickColor.new("Institutional white")
5007TextLabel53.BackgroundColor3 = Color3.new(1, 1, 1)
5008TextLabel53.BackgroundTransparency = 1
5009TextLabel53.ZIndex = 10
5010TextLabel53.Font = Enum.Font.ArialBold
5011TextLabel53.FontSize = Enum.FontSize.Size18
5012TextLabel53.Text = "0"
5013TextLabel53.TextColor = BrickColor.new("Really black")
5014TextLabel53.TextColor3 = Color3.new(0, 0, 0)
5015TextLabel53.TextSize = 18
5016TextLabel53.TextXAlignment = Enum.TextXAlignment.Right
5017Frame54.Name = "Tacticals"
5018Frame54.Parent = Frame49
5019Frame54.Position = UDim2.new(0.5, 2, 0, 0)
5020Frame54.Size = UDim2.new(0.5, -2, 1, 0)
5021Frame54.BackgroundColor = BrickColor.new("Institutional white")
5022Frame54.BackgroundColor3 = Color3.new(1, 1, 1)
5023Frame54.BorderSizePixel = 0
5024Frame54.ZIndex = 10
5025ImageLabel55.Name = "Icon"
5026ImageLabel55.Parent = Frame54
5027ImageLabel55.Position = UDim2.new(0, 7, 0, 2)
5028ImageLabel55.Size = UDim2.new(0, 21, 0, 21)
5029ImageLabel55.BackgroundColor = BrickColor.new("Institutional white")
5030ImageLabel55.BackgroundColor3 = Color3.new(1, 1, 1)
5031ImageLabel55.BackgroundTransparency = 1
5032ImageLabel55.ZIndex = 10
5033TextLabel56.Name = "Num"
5034TextLabel56.Parent = Frame54
5035TextLabel56.Position = UDim2.new(1, -7, 0, 0)
5036TextLabel56.Size = UDim2.new(0, 0, 1, 0)
5037TextLabel56.BackgroundColor = BrickColor.new("Institutional white")
5038TextLabel56.BackgroundColor3 = Color3.new(1, 1, 1)
5039TextLabel56.BackgroundTransparency = 1
5040TextLabel56.ZIndex = 10
5041TextLabel56.Font = Enum.Font.ArialBold
5042TextLabel56.FontSize = Enum.FontSize.Size18
5043TextLabel56.Text = "0"
5044TextLabel56.TextColor = BrickColor.new("Really black")
5045TextLabel56.TextColor3 = Color3.new(0, 0, 0)
5046TextLabel56.TextSize = 18
5047TextLabel56.TextXAlignment = Enum.TextXAlignment.Right
5048TextLabel57.Name = "Mult"
5049TextLabel57.Parent = Frame54
5050TextLabel57.Position = UDim2.new(0.5, -10, 0, 0)
5051TextLabel57.Size = UDim2.new(0, 20, 1, 0)
5052TextLabel57.BackgroundColor = BrickColor.new("Institutional white")
5053TextLabel57.BackgroundColor3 = Color3.new(1, 1, 1)
5054TextLabel57.BackgroundTransparency = 1
5055TextLabel57.BorderSizePixel = 0
5056TextLabel57.ZIndex = 10
5057TextLabel57.Font = Enum.Font.ArialBold
5058TextLabel57.FontSize = Enum.FontSize.Size18
5059TextLabel57.Text = "X"
5060TextLabel57.TextColor = BrickColor.new("Really black")
5061TextLabel57.TextColor3 = Color3.new(0, 0, 0)
5062TextLabel57.TextSize = 18
5063Frame58.Name = "Health"
5064Frame58.Parent = Frame41
5065Frame58.Position = UDim2.new(0, 25, 0, 20)
5066Frame58.Visible = false
5067Frame58.Size = UDim2.new(0.400000006, 0, 0, 25)
5068Frame58.BackgroundColor = BrickColor.new("Dirt brown")
5069Frame58.BackgroundColor3 = Color3.new(0.247059, 0.247059, 0.247059)
5070Frame58.BackgroundTransparency = 1
5071Frame58.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
5072Frame58.BorderSizePixel = 0
5073Frame58.Draggable = true
5074Frame58.ZIndex = 10
5075TextLabel59.Name = "Num"
5076TextLabel59.Parent = Frame58
5077TextLabel59.Position = UDim2.new(1, -50, 0, 0)
5078TextLabel59.Size = UDim2.new(0, 50, 1, 0)
5079TextLabel59.BackgroundColor = BrickColor.new("Really black")
5080TextLabel59.BackgroundColor3 = Color3.new(0, 0, 0)
5081TextLabel59.BackgroundTransparency = 1
5082TextLabel59.BorderColor = BrickColor.new("Really black")
5083TextLabel59.BorderColor3 = Color3.new(0, 0, 0)
5084TextLabel59.BorderSizePixel = 0
5085TextLabel59.ZIndex = 10
5086TextLabel59.Font = Enum.Font.SourceSansBold
5087TextLabel59.FontSize = Enum.FontSize.Size24
5088TextLabel59.Text = "100%"
5089TextLabel59.TextColor = BrickColor.new("Institutional white")
5090TextLabel59.TextColor3 = Color3.new(1, 1, 1)
5091TextLabel59.TextSize = 24
5092TextLabel59.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
5093TextLabel59.TextXAlignment = Enum.TextXAlignment.Right
5094Frame60.Name = "Tray"
5095Frame60.Parent = Frame58
5096Frame60.Position = UDim2.new(0, 2, 0.5, -10)
5097Frame60.Visible = false
5098Frame60.Size = UDim2.new(1, -60, 0, 20)
5099Frame60.BackgroundColor = BrickColor.new("Really black")
5100Frame60.BackgroundColor3 = Color3.new(0, 0, 0)
5101Frame60.BackgroundTransparency = 1
5102Frame60.BorderColor = BrickColor.new("Really black")
5103Frame60.BorderColor3 = Color3.new(0, 0, 0)
5104Frame60.BorderSizePixel = 0
5105Frame60.ClipsDescendants = true
5106Frame60.ZIndex = 10
5107Frame61.Name = "Beat"
5108Frame61.Parent = Frame60
5109Frame61.Position = UDim2.new(1, 0, 0, 0)
5110Frame61.Size = UDim2.new(0, 21, 1, 0)
5111Frame61.BackgroundColor = BrickColor.new("Really black")
5112Frame61.BackgroundColor3 = Color3.new(0, 0, 0)
5113Frame61.BackgroundTransparency = 1
5114Frame61.BorderColor = BrickColor.new("Really black")
5115Frame61.BorderColor3 = Color3.new(0, 0, 0)
5116Frame61.BorderSizePixel = 0
5117Frame61.ZIndex = 10
5118Frame62.Name = "00"
5119Frame62.Parent = Frame61
5120Frame62.Position = UDim2.new(0, 0, 0.5, -2)
5121Frame62.Size = UDim2.new(0.0476190485, 0, 0, 3)
5122Frame62.BackgroundColor = BrickColor.new("Institutional white")
5123Frame62.BackgroundColor3 = Color3.new(1, 1, 1)
5124Frame62.BorderColor = BrickColor.new("Really black")
5125Frame62.BorderColor3 = Color3.new(0, 0, 0)
5126Frame62.BorderSizePixel = 0
5127Frame62.ZIndex = 10
5128Frame63.Name = "01"
5129Frame63.Parent = Frame61
5130Frame63.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
5131Frame63.Size = UDim2.new(0.0476190485, 0, 0, 4)
5132Frame63.BackgroundColor = BrickColor.new("Institutional white")
5133Frame63.BackgroundColor3 = Color3.new(1, 1, 1)
5134Frame63.BorderColor = BrickColor.new("Really black")
5135Frame63.BorderColor3 = Color3.new(0, 0, 0)
5136Frame63.BorderSizePixel = 0
5137Frame63.ZIndex = 10
5138Frame64.Name = "02"
5139Frame64.Parent = Frame61
5140Frame64.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
5141Frame64.Size = UDim2.new(0.0476190485, 0, 0, 4)
5142Frame64.BackgroundColor = BrickColor.new("Institutional white")
5143Frame64.BackgroundColor3 = Color3.new(1, 1, 1)
5144Frame64.BorderColor = BrickColor.new("Really black")
5145Frame64.BorderColor3 = Color3.new(0, 0, 0)
5146Frame64.BorderSizePixel = 0
5147Frame64.ZIndex = 10
5148Frame65.Name = "03"
5149Frame65.Parent = Frame61
5150Frame65.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
5151Frame65.Size = UDim2.new(0.0476190485, 0, 0, 4)
5152Frame65.BackgroundColor = BrickColor.new("Institutional white")
5153Frame65.BackgroundColor3 = Color3.new(1, 1, 1)
5154Frame65.BorderColor = BrickColor.new("Really black")
5155Frame65.BorderColor3 = Color3.new(0, 0, 0)
5156Frame65.BorderSizePixel = 0
5157Frame65.ZIndex = 10
5158Frame66.Name = "04"
5159Frame66.Parent = Frame61
5160Frame66.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
5161Frame66.Size = UDim2.new(0.0476190485, 0, 0, 4)
5162Frame66.BackgroundColor = BrickColor.new("Institutional white")
5163Frame66.BackgroundColor3 = Color3.new(1, 1, 1)
5164Frame66.BorderColor = BrickColor.new("Really black")
5165Frame66.BorderColor3 = Color3.new(0, 0, 0)
5166Frame66.BorderSizePixel = 0
5167Frame66.ZIndex = 10
5168Frame67.Name = "05"
5169Frame67.Parent = Frame61
5170Frame67.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
5171Frame67.Size = UDim2.new(0.0476190485, 0, 0, 4)
5172Frame67.BackgroundColor = BrickColor.new("Institutional white")
5173Frame67.BackgroundColor3 = Color3.new(1, 1, 1)
5174Frame67.BorderColor = BrickColor.new("Really black")
5175Frame67.BorderColor3 = Color3.new(0, 0, 0)
5176Frame67.BorderSizePixel = 0
5177Frame67.ZIndex = 10
5178Frame68.Name = "06"
5179Frame68.Parent = Frame61
5180Frame68.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
5181Frame68.Size = UDim2.new(0.0476190485, 0, 0, 4)
5182Frame68.BackgroundColor = BrickColor.new("Institutional white")
5183Frame68.BackgroundColor3 = Color3.new(1, 1, 1)
5184Frame68.BorderColor = BrickColor.new("Really black")
5185Frame68.BorderColor3 = Color3.new(0, 0, 0)
5186Frame68.BorderSizePixel = 0
5187Frame68.ZIndex = 10
5188Frame69.Name = "07"
5189Frame69.Parent = Frame61
5190Frame69.Position = UDim2.new(0.333333343, 0, 0, -2)
5191Frame69.Size = UDim2.new(0.0476190485, 0, 0, 4)
5192Frame69.BackgroundColor = BrickColor.new("Institutional white")
5193Frame69.BackgroundColor3 = Color3.new(1, 1, 1)
5194Frame69.BorderColor = BrickColor.new("Really black")
5195Frame69.BorderColor3 = Color3.new(0, 0, 0)
5196Frame69.BorderSizePixel = 0
5197Frame69.ZIndex = 10
5198Frame70.Name = "08"
5199Frame70.Parent = Frame61
5200Frame70.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
5201Frame70.Size = UDim2.new(0.0476190485, 0, 0, 4)
5202Frame70.BackgroundColor = BrickColor.new("Institutional white")
5203Frame70.BackgroundColor3 = Color3.new(1, 1, 1)
5204Frame70.BorderColor = BrickColor.new("Really black")
5205Frame70.BorderColor3 = Color3.new(0, 0, 0)
5206Frame70.BorderSizePixel = 0
5207Frame70.ZIndex = 10
5208Frame71.Name = "09"
5209Frame71.Parent = Frame61
5210Frame71.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
5211Frame71.Size = UDim2.new(0.0476190485, 0, 0, 4)
5212Frame71.BackgroundColor = BrickColor.new("Institutional white")
5213Frame71.BackgroundColor3 = Color3.new(1, 1, 1)
5214Frame71.BorderColor = BrickColor.new("Really black")
5215Frame71.BorderColor3 = Color3.new(0, 0, 0)
5216Frame71.BorderSizePixel = 0
5217Frame71.ZIndex = 10
5218Frame72.Name = "10"
5219Frame72.Parent = Frame61
5220Frame72.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
5221Frame72.Size = UDim2.new(0.0476190485, 0, 0, 4)
5222Frame72.BackgroundColor = BrickColor.new("Institutional white")
5223Frame72.BackgroundColor3 = Color3.new(1, 1, 1)
5224Frame72.BorderColor = BrickColor.new("Really black")
5225Frame72.BorderColor3 = Color3.new(0, 0, 0)
5226Frame72.BorderSizePixel = 0
5227Frame72.ZIndex = 10
5228Frame73.Name = "11"
5229Frame73.Parent = Frame61
5230Frame73.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
5231Frame73.Size = UDim2.new(0.0476190485, 0, 0, 4)
5232Frame73.BackgroundColor = BrickColor.new("Institutional white")
5233Frame73.BackgroundColor3 = Color3.new(1, 1, 1)
5234Frame73.BorderColor = BrickColor.new("Really black")
5235Frame73.BorderColor3 = Color3.new(0, 0, 0)
5236Frame73.BorderSizePixel = 0
5237Frame73.ZIndex = 10
5238Frame74.Name = "12"
5239Frame74.Parent = Frame61
5240Frame74.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
5241Frame74.Size = UDim2.new(0.0476190485, 0, 0, 4)
5242Frame74.BackgroundColor = BrickColor.new("Institutional white")
5243Frame74.BackgroundColor3 = Color3.new(1, 1, 1)
5244Frame74.BorderColor = BrickColor.new("Really black")
5245Frame74.BorderColor3 = Color3.new(0, 0, 0)
5246Frame74.BorderSizePixel = 0
5247Frame74.ZIndex = 10
5248Frame75.Name = "13"
5249Frame75.Parent = Frame61
5250Frame75.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
5251Frame75.Size = UDim2.new(0.0476190485, 0, 0, 4)
5252Frame75.BackgroundColor = BrickColor.new("Institutional white")
5253Frame75.BackgroundColor3 = Color3.new(1, 1, 1)
5254Frame75.BorderColor = BrickColor.new("Really black")
5255Frame75.BorderColor3 = Color3.new(0, 0, 0)
5256Frame75.BorderSizePixel = 0
5257Frame75.ZIndex = 10
5258Frame76.Name = "14"
5259Frame76.Parent = Frame61
5260Frame76.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
5261Frame76.Size = UDim2.new(0.0476190485, 0, 0, 4)
5262Frame76.BackgroundColor = BrickColor.new("Institutional white")
5263Frame76.BackgroundColor3 = Color3.new(1, 1, 1)
5264Frame76.BorderColor = BrickColor.new("Really black")
5265Frame76.BorderColor3 = Color3.new(0, 0, 0)
5266Frame76.BorderSizePixel = 0
5267Frame76.ZIndex = 10
5268Frame77.Name = "15"
5269Frame77.Parent = Frame61
5270Frame77.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
5271Frame77.Size = UDim2.new(0.0476190485, 0, 0, 4)
5272Frame77.BackgroundColor = BrickColor.new("Institutional white")
5273Frame77.BackgroundColor3 = Color3.new(1, 1, 1)
5274Frame77.BorderColor = BrickColor.new("Really black")
5275Frame77.BorderColor3 = Color3.new(0, 0, 0)
5276Frame77.BorderSizePixel = 0
5277Frame77.ZIndex = 10
5278Frame78.Name = "16"
5279Frame78.Parent = Frame61
5280Frame78.Position = UDim2.new(0.761904776, 0, 0.75, -2)
5281Frame78.Size = UDim2.new(0.0476190485, 0, 0, 4)
5282Frame78.BackgroundColor = BrickColor.new("Institutional white")
5283Frame78.BackgroundColor3 = Color3.new(1, 1, 1)
5284Frame78.BorderColor = BrickColor.new("Really black")
5285Frame78.BorderColor3 = Color3.new(0, 0, 0)
5286Frame78.BorderSizePixel = 0
5287Frame78.ZIndex = 10
5288Frame79.Name = "17"
5289Frame79.Parent = Frame61
5290Frame79.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
5291Frame79.Size = UDim2.new(0.0476190485, 0, 0, 4)
5292Frame79.BackgroundColor = BrickColor.new("Institutional white")
5293Frame79.BackgroundColor3 = Color3.new(1, 1, 1)
5294Frame79.BorderColor = BrickColor.new("Really black")
5295Frame79.BorderColor3 = Color3.new(0, 0, 0)
5296Frame79.BorderSizePixel = 0
5297Frame79.ZIndex = 10
5298Frame80.Name = "18"
5299Frame80.Parent = Frame61
5300Frame80.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
5301Frame80.Size = UDim2.new(0.0476190485, 0, 0, 4)
5302Frame80.BackgroundColor = BrickColor.new("Institutional white")
5303Frame80.BackgroundColor3 = Color3.new(1, 1, 1)
5304Frame80.BorderColor = BrickColor.new("Really black")
5305Frame80.BorderColor3 = Color3.new(0, 0, 0)
5306Frame80.BorderSizePixel = 0
5307Frame80.ZIndex = 10
5308Frame81.Name = "19"
5309Frame81.Parent = Frame61
5310Frame81.Position = UDim2.new(0.90476191, 0, 0.5, -2)
5311Frame81.Size = UDim2.new(0.0476190485, 0, 0, 4)
5312Frame81.BackgroundColor = BrickColor.new("Institutional white")
5313Frame81.BackgroundColor3 = Color3.new(1, 1, 1)
5314Frame81.BorderColor = BrickColor.new("Really black")
5315Frame81.BorderColor3 = Color3.new(0, 0, 0)
5316Frame81.BorderSizePixel = 0
5317Frame81.ZIndex = 10
5318Frame82.Name = "20"
5319Frame82.Parent = Frame61
5320Frame82.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
5321Frame82.Size = UDim2.new(0.0476190485, 0, 0, 4)
5322Frame82.BackgroundColor = BrickColor.new("Institutional white")
5323Frame82.BackgroundColor3 = Color3.new(1, 1, 1)
5324Frame82.BorderColor = BrickColor.new("Really black")
5325Frame82.BorderColor3 = Color3.new(0, 0, 0)
5326Frame82.BorderSizePixel = 0
5327Frame82.ZIndex = 10
5328Frame83.Name = "Line"
5329Frame83.Parent = Frame61
5330Frame83.Position = UDim2.new(1, 0, 0.5, -2)
5331Frame83.Size = UDim2.new(0, 200, 0, 3)
5332Frame83.BackgroundColor = BrickColor.new("Institutional white")
5333Frame83.BackgroundColor3 = Color3.new(1, 1, 1)
5334Frame83.BorderColor = BrickColor.new("Really black")
5335Frame83.BorderColor3 = Color3.new(0, 0, 0)
5336Frame83.BorderSizePixel = 0
5337Frame83.ZIndex = 10
5338Frame84.Name = "Line"
5339Frame84.Parent = Frame61
5340Frame84.Position = UDim2.new(0, -200, 0.5, -2)
5341Frame84.Size = UDim2.new(0, 200, 0, 3)
5342Frame84.BackgroundColor = BrickColor.new("Institutional white")
5343Frame84.BackgroundColor3 = Color3.new(1, 1, 1)
5344Frame84.BorderColor = BrickColor.new("Really black")
5345Frame84.BorderColor3 = Color3.new(0, 0, 0)
5346Frame84.BorderSizePixel = 0
5347Frame84.ZIndex = 10
5348Frame85.Name = "Mode"
5349Frame85.Parent = Frame41
5350Frame85.Position = UDim2.new(0, 37, 1, -70)
5351Frame85.Size = UDim2.new(0, 85, 0, 20)
5352Frame85.BackgroundColor = BrickColor.new("Institutional white")
5353Frame85.BackgroundColor3 = Color3.new(1, 1, 1)
5354Frame85.BackgroundTransparency = 1
5355Frame85.ZIndex = 10
5356TextLabel86.Name = "Bracket"
5357TextLabel86.Parent = Frame85
5358TextLabel86.Size = UDim2.new(0, 5, 0, 20)
5359TextLabel86.BackgroundTransparency = 1
5360TextLabel86.ZIndex = 10
5361TextLabel86.Font = Enum.Font.ArialBold
5362TextLabel86.FontSize = Enum.FontSize.Size18
5363TextLabel86.Text = "["
5364TextLabel86.TextColor = BrickColor.new("Institutional white")
5365TextLabel86.TextColor3 = Color3.new(1, 1, 1)
5366TextLabel86.TextSize = 18
5367TextLabel86.TextXAlignment = Enum.TextXAlignment.Left
5368TextLabel87.Name = "Bracket"
5369TextLabel87.Parent = Frame85
5370TextLabel87.Position = UDim2.new(1, -5, 0, 0)
5371TextLabel87.Size = UDim2.new(0, 5, 0, 20)
5372TextLabel87.BackgroundTransparency = 1
5373TextLabel87.ZIndex = 10
5374TextLabel87.Font = Enum.Font.ArialBold
5375TextLabel87.FontSize = Enum.FontSize.Size18
5376TextLabel87.Text = "]"
5377TextLabel87.TextColor = BrickColor.new("Institutional white")
5378TextLabel87.TextColor3 = Color3.new(1, 1, 1)
5379TextLabel87.TextSize = 18
5380TextLabel87.TextXAlignment = Enum.TextXAlignment.Left
5381TextLabel88.Name = "Main"
5382TextLabel88.Parent = Frame85
5383TextLabel88.Size = UDim2.new(1, 0, 0, 20)
5384TextLabel88.BackgroundTransparency = 1
5385TextLabel88.ZIndex = 10
5386TextLabel88.Font = Enum.Font.Code
5387TextLabel88.FontSize = Enum.FontSize.Size18
5388TextLabel88.Text = "Auto"
5389TextLabel88.TextColor = BrickColor.new("Institutional white")
5390TextLabel88.TextColor3 = Color3.new(1, 1, 1)
5391TextLabel88.TextSize = 18
5392TextLabel88.TextWrap = true
5393TextLabel88.TextWrapped = true
5394Frame89.Name = "gunName"
5395Frame89.Parent = Frame41
5396Frame89.Size = UDim2.new(1, 0, 0, 36)
5397Frame89.BackgroundColor = BrickColor.new("Dark grey metallic")
5398Frame89.BackgroundColor3 = Color3.new(0.352941, 0.352941, 0.352941)
5399Frame89.BackgroundTransparency = 1
5400Frame89.ZIndex = 10
5401TextLabel90.Name = "Title"
5402TextLabel90.Parent = Frame89
5403TextLabel90.Position = UDim2.new(0, 0, 0, 23)
5404TextLabel90.Size = UDim2.new(1, 0, 1, 0)
5405TextLabel90.BackgroundColor = BrickColor.new("Institutional white")
5406TextLabel90.BackgroundColor3 = Color3.new(1, 1, 1)
5407TextLabel90.BackgroundTransparency = 1
5408TextLabel90.ZIndex = 10
5409TextLabel90.Font = Enum.Font.Code
5410TextLabel90.FontSize = Enum.FontSize.Size36
5411TextLabel90.Text = "GUN NAME"
5412TextLabel90.TextColor = BrickColor.new("Institutional white")
5413TextLabel90.TextColor3 = Color3.new(1, 1, 1)
5414TextLabel90.TextScaled = true
5415TextLabel90.TextSize = 36
5416TextLabel90.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
5417TextLabel90.TextWrap = true
5418TextLabel90.TextWrapped = true
5419TextLabel91.Name = "Version"
5420TextLabel91.Parent = Frame41
5421TextLabel91.Position = UDim2.new(1, 10, 1, 0)
5422TextLabel91.Size = UDim2.new(1, 0, 0, 15)
5423TextLabel91.BackgroundColor = BrickColor.new("Institutional white")
5424TextLabel91.BackgroundColor3 = Color3.new(1, 1, 1)
5425TextLabel91.BackgroundTransparency = 1
5426TextLabel91.ZIndex = 10
5427TextLabel91.Font = Enum.Font.ArialBold
5428TextLabel91.FontSize = Enum.FontSize.Size14
5429TextLabel91.Text = "V0.4 - REMAKE"
5430TextLabel91.TextColor = BrickColor.new("Institutional white")
5431TextLabel91.TextColor3 = Color3.new(1, 1, 1)
5432TextLabel91.TextSize = 14
5433TextLabel91.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
5434TextLabel91.TextStrokeTransparency = 0.60000002384186
5435TextLabel91.TextTransparency = 0.60000002384186
5436TextLabel91.TextWrap = true
5437TextLabel91.TextWrapped = true
5438TextLabel91.TextXAlignment = Enum.TextXAlignment.Right
5439ImageLabel92.Name = "hitMarker"
5440ImageLabel92.Parent = ScreenGui40
5441ImageLabel92.Position = UDim2.new(0.5, -13, 0.5, -31)
5442ImageLabel92.Visible = false
5443ImageLabel92.Size = UDim2.new(0, 26, 0, 26)
5444ImageLabel92.BackgroundTransparency = 1
5445ImageLabel92.ZIndex = 10
5446ImageLabel92.Image = "http://www.roblox.com/asset/?id=121173757"
5447NumberValue93.Name = "lastMark"
5448NumberValue93.Parent = ImageLabel92
5449TextLabel94.Name = "Sens"
5450TextLabel94.Parent = ScreenGui40
5451TextLabel94.Position = UDim2.new(1, -131, 1, -25)
5452TextLabel94.Size = UDim2.new(0, 100, 0, 20)
5453TextLabel94.BackgroundColor = BrickColor.new("Institutional white")
5454TextLabel94.BackgroundColor3 = Color3.new(1, 1, 1)
5455TextLabel94.BackgroundTransparency = 1
5456TextLabel94.ZIndex = 10
5457TextLabel94.Font = Enum.Font.Code
5458TextLabel94.FontSize = Enum.FontSize.Size28
5459TextLabel94.Text = "S: 0.3"
5460TextLabel94.TextColor = BrickColor.new("Institutional white")
5461TextLabel94.TextColor3 = Color3.new(1, 1, 1)
5462TextLabel94.TextSize = 28
5463Frame95.Name = "Scope"
5464Frame95.Parent = ScreenGui40
5465Frame95.Position = UDim2.new(0, 0, 0, -36)
5466Frame95.Visible = false
5467Frame95.Size = UDim2.new(1, 0, 1, 36)
5468Frame95.BackgroundColor = BrickColor.new("Really black")
5469Frame95.BackgroundColor3 = Color3.new(0, 0, 0)
5470Frame95.BackgroundTransparency = 1
5471TextLabel96.Name = "Steady"
5472TextLabel96.Parent = Frame95
5473TextLabel96.Position = UDim2.new(0.5, -60, 0.5, 50)
5474TextLabel96.Visible = false
5475TextLabel96.Size = UDim2.new(0, 120, 0, 20)
5476TextLabel96.BackgroundColor = BrickColor.new("Institutional white")
5477TextLabel96.BackgroundColor3 = Color3.new(1, 1, 1)
5478TextLabel96.BackgroundTransparency = 1
5479TextLabel96.ZIndex = 9
5480TextLabel96.Font = Enum.Font.ArialBold
5481TextLabel96.FontSize = Enum.FontSize.Size14
5482TextLabel96.Text = ""
5483TextLabel96.TextColor = BrickColor.new("New Yeller")
5484TextLabel96.TextColor3 = Color3.new(1, 1, 0)
5485TextLabel96.TextSize = 14
5486TextLabel96.TextStrokeTransparency = 0
5487Frame97.Name = "Main"
5488Frame97.Parent = Frame95
5489Frame97.Size = UDim2.new(1, 0, 1, 0)
5490Frame97.BackgroundColor = BrickColor.new("Institutional white")
5491Frame97.BackgroundColor3 = Color3.new(1, 1, 1)
5492Frame97.BackgroundTransparency = 1
5493ImageLabel98.Name = "ScopeImg2"
5494ImageLabel98.Parent = Frame97
5495ImageLabel98.Position = UDim2.new(0.5, -10, 0, -10)
5496ImageLabel98.Size = UDim2.new(0, 20, 0, 20)
5497ImageLabel98.BackgroundColor = BrickColor.new("Really black")
5498ImageLabel98.BackgroundColor3 = Color3.new(0, 0, 0)
5499ImageLabel98.BackgroundTransparency = 1
5500ImageLabel98.Image = "http://www.roblox.com/asset/?id=184922644"
5501ImageLabel99.Name = "ScopeImg1"
5502ImageLabel99.Parent = Frame97
5503ImageLabel99.Position = UDim2.new(0.5, -10, 0, -10)
5504ImageLabel99.Size = UDim2.new(0, 20, 0, 20)
5505ImageLabel99.BackgroundColor = BrickColor.new("Really black")
5506ImageLabel99.BackgroundColor3 = Color3.new(0, 0, 0)
5507ImageLabel99.BackgroundTransparency = 1
5508ImageLabel99.Image = "http://www.roblox.com/asset/?id=72002022"
5509Frame100.Name = "F2"
5510Frame100.Parent = Frame97
5511Frame100.Position = UDim2.new(0, -10, 0, -10)
5512Frame100.Size = UDim2.new(0, 0, 1, 20)
5513Frame100.BackgroundColor = BrickColor.new("Really black")
5514Frame100.BackgroundColor3 = Color3.new(0, 0, 0)
5515Frame100.BorderColor = BrickColor.new("Really black")
5516Frame100.BorderColor3 = Color3.new(0, 0, 0)
5517Frame100.BorderSizePixel = 0
5518Frame101.Name = "F1"
5519Frame101.Parent = Frame97
5520Frame101.Position = UDim2.new(0, -10, 0, -10)
5521Frame101.Size = UDim2.new(0, 0, 1, 20)
5522Frame101.BackgroundColor = BrickColor.new("Really black")
5523Frame101.BackgroundColor3 = Color3.new(0, 0, 0)
5524Frame101.BorderColor = BrickColor.new("Really black")
5525Frame101.BorderColor3 = Color3.new(0, 0, 0)
5526Frame101.BorderSizePixel = 0
5527LocalScript102.Name = "Update"
5528LocalScript102.Parent = Frame97
5529table.insert(cors,sandbox(LocalScript102,function()
5530local GUI = script.Parent
5531
5532function updateScopeDimension()
5533 GUI.ScopeImg1.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
5534 GUI.ScopeImg1.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
5535 GUI.ScopeImg2.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
5536 GUI.ScopeImg2.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
5537 GUI.F1.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
5538 GUI.F2.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
5539 GUI.F2.Position = UDim2.new(1, -10 - ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 0, -10)
5540end
5541
5542wait()
5543
5544GUI.Changed:connect(updateScopeDimension)
5545
5546updateScopeDimension()
5547end))
5548Frame103.Name = "fireSelect"
5549Frame103.Parent = ScreenGui40
5550Frame103.Position = UDim2.new(0.5, 0, 0.5, -18)
5551Frame103.Visible = false
5552Frame103.BackgroundColor = BrickColor.new("Institutional white")
5553Frame103.BackgroundColor3 = Color3.new(1, 1, 1)
5554Frame103.BackgroundTransparency = 1
5555Frame104.Name = "Modes"
5556Frame104.Parent = Frame103
5557Frame104.BackgroundColor = BrickColor.new("Institutional white")
5558Frame104.BackgroundColor3 = Color3.new(1, 1, 1)
5559Frame104.BackgroundTransparency = 1
5560ImageLabel105.Name = "Circle"
5561ImageLabel105.Parent = Frame103
5562ImageLabel105.Position = UDim2.new(0, -60, 0, -60)
5563ImageLabel105.Size = UDim2.new(0, 120, 0, 120)
5564ImageLabel105.BackgroundColor = BrickColor.new("Institutional white")
5565ImageLabel105.BackgroundColor3 = Color3.new(1, 1, 1)
5566ImageLabel105.BackgroundTransparency = 1
5567ImageLabel105.Image = "http://www.roblox.com/asset/?id=55754953"
5568ImageLabel105.ImageTransparency = 0.5
5569ImageLabel106.Name = "Arrow"
5570ImageLabel106.Parent = Frame103
5571ImageLabel106.Position = UDim2.new(0, -20, 0, -140)
5572ImageLabel106.Size = UDim2.new(0, 40, 0, 20)
5573ImageLabel106.BackgroundColor = BrickColor.new("Institutional white")
5574ImageLabel106.BackgroundColor3 = Color3.new(1, 1, 1)
5575ImageLabel106.BackgroundTransparency = 1
5576ImageLabel106.Image = "http://www.roblox.com/asset/?id=126877530"
5577TextLabel107.Name = "Co"
5578TextLabel107.Parent = ScreenGui40
5579TextLabel107.Size = UDim2.new(1, 0, 0, 20)
5580TextLabel107.BackgroundColor = BrickColor.new("Institutional white")
5581TextLabel107.BackgroundColor3 = Color3.new(1, 1, 1)
5582TextLabel107.BackgroundTransparency = 1
5583TextLabel107.ZIndex = 10
5584TextLabel107.Font = Enum.Font.SourceSansItalic
5585TextLabel107.FontSize = Enum.FontSize.Size18
5586TextLabel107.Text = "tEhYuM yB ekameR & noisuFobruT yB tiK"
5587TextLabel107.TextColor = BrickColor.new("Institutional white")
5588TextLabel107.TextColor3 = Color3.new(1, 1, 1)
5589TextLabel107.TextSize = 18
5590TextLabel107.TextStrokeColor3 = Color3.new(1, 1, 1)
5591TextLabel107.TextStrokeTransparency = 0.89999997615814
5592TextLabel107.TextTransparency = 0.89999997615814
5593Frame108.Name = "crossHair"
5594Frame108.Parent = ScreenGui40
5595Frame108.Position = UDim2.new(0.5, 0, 0.5, -18)
5596Frame108.Visible = false
5597Frame108.BackgroundColor = BrickColor.new("Institutional white")
5598Frame108.BackgroundColor3 = Color3.new(1, 1, 1)
5599Frame108.BorderColor = BrickColor.new("Really black")
5600Frame108.BorderColor3 = Color3.new(0, 0, 0)
5601Frame108.BorderSizePixel = 0
5602ImageLabel109.Parent = Frame108
5603ImageLabel109.Position = UDim2.new(0, -150, 0, -150)
5604ImageLabel109.Visible = false
5605ImageLabel109.Size = UDim2.new(0, 300, 0, 300)
5606ImageLabel109.BackgroundColor = BrickColor.new("Institutional white")
5607ImageLabel109.BackgroundColor3 = Color3.new(1, 1, 1)
5608ImageLabel109.BackgroundTransparency = 1
5609ImageLabel109.ZIndex = 2
5610ImageLabel109.Image = "http://www.roblox.com/asset/?id=68308747"
5611TextLabel110.Name = "Reload"
5612TextLabel110.Parent = Frame108
5613TextLabel110.Position = UDim2.new(0, -50, 0, 70)
5614TextLabel110.Visible = false
5615TextLabel110.Size = UDim2.new(0, 100, 0, 20)
5616TextLabel110.BackgroundColor = BrickColor.new("Institutional white")
5617TextLabel110.BackgroundColor3 = Color3.new(1, 1, 1)
5618TextLabel110.BackgroundTransparency = 1
5619TextLabel110.ZIndex = 2
5620TextLabel110.Font = Enum.Font.SourceSansBold
5621TextLabel110.FontSize = Enum.FontSize.Size18
5622TextLabel110.Text = "RELOADING..."
5623TextLabel110.TextColor = BrickColor.new("Institutional white")
5624TextLabel110.TextColor3 = Color3.new(1, 1, 1)
5625TextLabel110.TextSize = 18
5626TextLabel110.TextStrokeTransparency = 0.5
5627Frame111.Name = "C"
5628Frame111.Parent = Frame108
5629Frame111.Position = UDim2.new(0, -2, 0, 0)
5630Frame111.Size = UDim2.new(0, 4, 0, 500)
5631Frame111.BackgroundColor = BrickColor.new("Institutional white")
5632Frame111.BackgroundColor3 = Color3.new(1, 1, 1)
5633Frame111.BackgroundTransparency = 1
5634Frame111.ClipsDescendants = true
5635TextLabel112.Name = "Line"
5636TextLabel112.Parent = Frame111
5637TextLabel112.Position = UDim2.new(0.5, -1, 0, 10)
5638TextLabel112.Size = UDim2.new(0, 2, 0, 15)
5639TextLabel112.BackgroundColor = BrickColor.new("Institutional white")
5640TextLabel112.BackgroundColor3 = Color3.new(1, 1, 1)
5641TextLabel112.BorderColor = BrickColor.new("Dark stone grey")
5642TextLabel112.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
5643TextLabel112.Font = Enum.Font.SourceSans
5644TextLabel112.FontSize = Enum.FontSize.Size14
5645TextLabel112.Text = ""
5646TextLabel112.TextSize = 14
5647Frame113.Name = "A"
5648Frame113.Parent = Frame108
5649Frame113.Position = UDim2.new(0, -2, 0, -500)
5650Frame113.Size = UDim2.new(0, 4, 0, 500)
5651Frame113.BackgroundColor = BrickColor.new("Institutional white")
5652Frame113.BackgroundColor3 = Color3.new(1, 1, 1)
5653Frame113.BackgroundTransparency = 1
5654Frame113.ClipsDescendants = true
5655TextLabel114.Name = "Line"
5656TextLabel114.Parent = Frame113
5657TextLabel114.Position = UDim2.new(0.5, -1, 1, -25)
5658TextLabel114.Size = UDim2.new(0, 2, 0, 15)
5659TextLabel114.BackgroundColor = BrickColor.new("Institutional white")
5660TextLabel114.BackgroundColor3 = Color3.new(1, 1, 1)
5661TextLabel114.BorderColor = BrickColor.new("Dark stone grey")
5662TextLabel114.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
5663TextLabel114.Font = Enum.Font.SourceSans
5664TextLabel114.FontSize = Enum.FontSize.Size14
5665TextLabel114.Text = ""
5666TextLabel114.TextSize = 14
5667Frame115.Name = "B"
5668Frame115.Parent = Frame108
5669Frame115.Position = UDim2.new(0, 0, 0, -2)
5670Frame115.Size = UDim2.new(0, 500, 0, 4)
5671Frame115.BackgroundColor = BrickColor.new("Institutional white")
5672Frame115.BackgroundColor3 = Color3.new(1, 1, 1)
5673Frame115.BackgroundTransparency = 1
5674Frame115.ClipsDescendants = true
5675TextLabel116.Name = "Line"
5676TextLabel116.Parent = Frame115
5677TextLabel116.Position = UDim2.new(0, 10, 0.5, -1)
5678TextLabel116.Size = UDim2.new(0, 15, 0, 2)
5679TextLabel116.BackgroundColor = BrickColor.new("Institutional white")
5680TextLabel116.BackgroundColor3 = Color3.new(1, 1, 1)
5681TextLabel116.BorderColor = BrickColor.new("Dark stone grey")
5682TextLabel116.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
5683TextLabel116.Font = Enum.Font.SourceSans
5684TextLabel116.FontSize = Enum.FontSize.Size14
5685TextLabel116.Text = ""
5686TextLabel116.TextSize = 14
5687Frame117.Name = "D"
5688Frame117.Parent = Frame108
5689Frame117.Position = UDim2.new(0, -500, 0, -2)
5690Frame117.Size = UDim2.new(0, 500, 0, 4)
5691Frame117.BackgroundColor = BrickColor.new("Institutional white")
5692Frame117.BackgroundColor3 = Color3.new(1, 1, 1)
5693Frame117.BackgroundTransparency = 1
5694Frame117.ClipsDescendants = true
5695TextLabel118.Name = "Line"
5696TextLabel118.Parent = Frame117
5697TextLabel118.Position = UDim2.new(1, -25, 0.5, -1)
5698TextLabel118.Size = UDim2.new(0, 15, 0, 2)
5699TextLabel118.BackgroundColor = BrickColor.new("Institutional white")
5700TextLabel118.BackgroundColor3 = Color3.new(1, 1, 1)
5701TextLabel118.BorderColor = BrickColor.new("Dark stone grey")
5702TextLabel118.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
5703TextLabel118.Font = Enum.Font.SourceSans
5704TextLabel118.FontSize = Enum.FontSize.Size14
5705TextLabel118.Text = ""
5706TextLabel118.TextSize = 14
5707ModuleScript119.Name = "ANIMATIONS"
5708ModuleScript119.Parent = Tool0
5709table.insert(cors,sandbox(ModuleScript119,function()
5710local Animations = {
5711
5712 Reload = function(S)
5713 local W1 = nil
5714 local W2 = nil
5715 local animSpeed = S.isMagEmpty() and S.reloadTimeEmpty / 1.3 or S.reloadTimeLoaded / 0.9
5716 return {
5717 function()
5718 if (not S.isNewMag()) then
5719 if S.isMagVisible() then
5720 local Mag1, magTable1 = S.createMag("Mag1")
5721
5722 Mag1.Parent = S.gunIgnore
5723
5724 W1 = Instance.new("Weld")
5725 W1.Part0 = magTable1[1].magClone
5726 W1.Part1 = S.Handle
5727 W1.C0 = magTable1[1].Original.CFrame:toObjectSpace(S.Handle.CFrame)
5728 W1.Parent = magTable1[1].magClone
5729
5730 S.tweenJoint(S.LWeld, nil, S.CF(-1, 1.2, -.6) * S.CFANG(S.RAD(-15), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
5731 S.tweenJoint(S.RWeld, nil, S.CF(0.3, 0.2, -0.31) * S.CFANG(S.RAD(-12), 0, S.RAD(25)), S.Sine, 0.2 * animSpeed)
5732 S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.1 * animSpeed)
5733 wait(0.2 * animSpeed)
5734 end
5735 end
5736 end;
5737
5738 function()
5739 if (not S.isNewMag()) then
5740 if S.isMagVisible() then
5741 S.makeMagInvisible()
5742 W1:Destroy()
5743 local Mag1, magTable1 = S.getMag("Mag1")
5744 magTable1[1].magClone.Velocity = S.Handle.Velocity + S.Handle.CFrame:vectorToWorldSpace(S.V3(0, -1, 0)) * 20
5745
5746 S.tweenJoint(S.RWeld, nil, S.CF(0.3, 0.2, -0.5) * S.CFANG(S.RAD(-20), S.RAD(10), S.RAD(25)), S.Sine, 0.25 * animSpeed)
5747 S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
5748 else
5749 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
5750 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
5751 end
5752
5753 S.tweenJoint(S.LWeld, nil, S.CF(0, 0.5, 0) * S.CFANG(S.RAD(95), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
5754 script.Parent.Handle.MagOut:Play()
5755 wait(0.25 * animSpeed)
5756 end
5757 end;
5758
5759 function()
5760 if (not S.isNewMag()) then
5761 local Mag1, magTable1 = S.getMag("Mag1")
5762 if Mag1 then Mag1:Destroy() end
5763
5764 local Mag2, magTable2 = S.createMag("Mag2")
5765
5766 Mag2.Parent = S.gunIgnore
5767
5768 local LArmCF = S.LWeld.Part0.CFrame * S.LWeld.C0 * (S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60))):inverse()
5769 local RArmCF = S.RWeld.Part0.CFrame * S.RWeld.C0 * (S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25))):inverse()
5770 local handleOffsetCF = S.RArm.CFrame:toObjectSpace(S.RArm.CFrame * S.Grip.C0 * (S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10))):inverse())
5771 local originalMagOffsetCF = S.Handle.CFrame:toObjectSpace(magTable2[1].Original.CFrame)
5772 local newMagC0 = LArmCF:toObjectSpace(RArmCF * handleOffsetCF * originalMagOffsetCF)
5773
5774 W2 = Instance.new("Weld")
5775 W2.Part0 = S.LArm
5776 W2.Part1 = magTable2[1].magClone
5777 W2.C0 = newMagC0
5778 W2.Parent = magTable2[1].magClone
5779
5780 S.tweenJoint(S.LWeld, nil, S.CF(0.55, 1, -2.4) * S.CFANG(S.RAD(-20), S.RAD(20), S.RAD(-60)), S.Sine, 0.2 * animSpeed)--0.25
5781 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
5782 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
5783 wait(0.2 * animSpeed)
5784 end
5785 end;
5786
5787 function()
5788 if (not S.isNewMag()) then
5789 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.15 * animSpeed)
5790 S.tweenJoint(S.LWeld, nil, S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60)), S.Sine, 0.15 * animSpeed)--0.25
5791 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
5792 script.Parent.Handle.MagIn:Play()
5793 wait(0.2 * animSpeed)
5794 end
5795 end;
5796
5797 function()
5798 if (not S.isNewMag()) then
5799 local Mag1, _ = S.getMag("Mag1")
5800 local Mag2, _ = S.getMag("Mag2")
5801 S.makeMagVisible()
5802 S.setNewMag()
5803 if Mag1 then Mag1:Destroy() end
5804 Mag2:Destroy()
5805 end
5806 end;
5807
5808 function()
5809 if S.isMagEmpty() then
5810 if S.isNewMag() then
5811 S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.15 * animSpeed)
5812 S.tweenJoint(S.LWeld, nil, S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60)), S.Sine, 0.15 * animSpeed)--0.25
5813 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
5814 end
5815 S.tweenJoint(S.LWeld, nil, S.CF(0, 1.3, -0.55) * S.CFANG(S.RAD(-26), 0, 0), S.Sine, 0.2 * animSpeed)
5816
5817 wait(0.2 * animSpeed)
5818 end
5819 end;
5820
5821 function()
5822 if S.isMagEmpty() then
5823 S.tweenJoint(S.LWeld, nil, S.CF(0.4, 1.6, -0.55) * S.CFANG(S.RAD(-23), 0, S.RAD(-60)), S.Sine, 0.1 * animSpeed)
5824
5825 wait(0.05 * animSpeed)
5826 end
5827 end;
5828
5829 function()
5830 if S.isMagEmpty() then
5831 S.tweenJoint(S.RWeld, nil, S.CF(0.6, 0.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(20)), S.Sine, 0.05 * animSpeed)
5832
5833 wait(0.15 * animSpeed)
5834 end
5835 end;
5836 }
5837 end;
5838
5839 Cocking = function(S)
5840
5841 end;
5842
5843 Crawling = function(X, moveDirection, moveSpeed)
5844 return {
5845 leftArm = CFrame.Angles(
5846 0,
5847 math.rad(90),
5848 math.rad(-10)
5849 ) * CFrame.new(
5850 math.sin(moveDirection) * (math.sin(X * 6) / 4) - 0.2,
5851 math.cos(moveDirection) * (math.sin(X * 6) / 2) - 0.1,
5852 math.max(math.cos(X * 6) / 4, 0) - 0.1
5853 ) * CFrame.Angles(
5854 -math.max(math.cos(X * 6) / 4, 0),
5855 0,
5856 0
5857 );
5858 leftLeg = CFrame.new(
5859 math.sin(moveDirection) * (-math.sin(X * 6) / 4) - 0.2,
5860 math.cos(moveDirection) * (math.sin(X * 6) / 2) + 0.3,
5861 math.max(math.cos(X * 6) / 4, 0) - 0.1
5862 ):inverse() * CFrame.Angles(
5863 0,
5864 0,
5865 -math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
5866 );
5867 rightArm = CFrame.Angles(
5868 0,
5869 math.rad(-5),
5870 math.rad(10)
5871 ) * CFrame.new(
5872 math.sin(moveDirection) * (-math.sin(X * 6) / 4) + 0.2,
5873 math.cos(moveDirection) * (-math.sin(X * 6) / 5) - 0.2,
5874 math.max(math.cos((X + math.rad(30)) * 6) / 10, 0) - 0.1
5875 ) * CFrame.Angles(
5876 -math.max(math.cos((X + math.rad(30)) * 6) / 10, 0),
5877 0,
5878 0
5879 );
5880 rightLeg = CFrame.new(
5881 math.sin(moveDirection) * (math.sin(X * 6) / 4) + 0.2,
5882 math.cos(moveDirection) * (-math.sin(X * 6) / 2) + 0.3,
5883 math.max(math.cos((X + math.rad(30)) * 6) / 4, 0) - 0.1
5884 ):inverse() * CFrame.Angles(
5885 0,
5886 0,
5887 math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
5888 );
5889 Grip = CFrame.Angles(
5890 math.max(math.cos((X + math.rad(30)) * 6) / 7, 0),
5891 math.rad(5),
5892 0
5893 );
5894 Camera = 1.5 * math.rad(math.cos((X + math.rad(30)) * 6)) + math.rad(0.5); --This is what the roll of the camera will be when you're crawling
5895 }
5896 end;
5897
5898 Idling = {
5899
5900 unAimed = function(X)
5901 return {
5902 Pos = Vector3.new(
5903 math.sin(X / 2) / 70,
5904 math.sin(X * 5 / 4) / 70,
5905 math.sin(X * 3 / 4) / 70
5906 );
5907 Rot = Vector3.new(
5908 0,
5909 0,
5910 0
5911 );
5912 }
5913 end;
5914
5915 Aimed = function(X)
5916 return {
5917 Pos = Vector3.new(
5918 math.sin(X * 3 / 8) / 140,
5919 math.sin(X * 15 / 16) / 140,
5920 0
5921 );
5922 Rot = Vector3.new(
5923 0,
5924 0,
5925 0
5926 );
5927 }
5928 end;
5929
5930 };
5931
5932 Walking = {
5933
5934 unAimed = function(X)
5935 return {
5936 Pos = Vector3.new(
5937 4 * math.sin(X * 4.5) / 50,
5938 1.5 * math.sin(X * 9) / 50,
5939 0
5940 );
5941 Rot = Vector3.new(
5942 0,
5943 0,
5944 math.rad(math.sin(X * 4.5)) * 2
5945 );
5946 }
5947 end;
5948
5949 Aimed = function(X)
5950 return {
5951 Pos = Vector3.new(
5952 2 * math.sin(X * 3) / 150,
5953 0.75 * math.sin(X * 6) / 150,
5954 0
5955 );
5956 Rot = Vector3.new(
5957 0,
5958 0,
5959 math.rad(math.sin(X * 3)) / 3
5960 );
5961 }
5962 end;
5963
5964 };
5965
5966 Running = function(X)
5967 return {
5968 Pos = Vector3.new(
5969 4 * math.sin(X * 4.5 * 1.5) / 30,
5970 1.5 * math.sin(X * 9 * 1.5) / 40 + 0.2,
5971 0
5972 );
5973 Rot = Vector3.new(
5974 0,
5975 -math.rad(math.sin(X * 4.5 * 1.5)) * 5 + math.rad(3),
5976 math.rad(math.sin(X * 4.5 * 1.5)) * 5
5977 );
5978 }
5979 end;
5980
5981}
5982
5983return Animations
5984end))
5985ModuleScript120.Name = "PLUGINS"
5986ModuleScript120.Parent = Tool0
5987table.insert(cors,sandbox(ModuleScript120,function()
5988--[[
5989
5990 Plugins for this gun kit are basically functions that will run at specific times, i.e. When a key is pressed, when the gun is
5991 fired, when the gun is aimed, etc.
5992
5993 HOW TO USE IT:
5994
5995 KEYDOWN PLUGIN:
5996
5997 Let's say you wanted to toggle a laser whenever you press the "v" key:
5998
5999 You would create a table like the example below
6000 The first element would be "Key = INSERT_KEY_HERE"
6001 The second element would be "Description = INSERT_DESCRIPTION_HERE"
6002 The third element would be "Plugin = INSERT_FUNCTION_HERE"
6003
6004 So whenever you press the "v" key, the plugin function will run
6005
6006 Pretty useful if you want to add extra code to the script without actually having to modify the script
6007
6008 NOTE: Only the keydown plugin requires this table. Every other plugin just needs a function
6009
6010 EVERY OTHER PLUGIN:
6011
6012 Let's say you wanted to make a shell eject whenever the gun was fired:
6013
6014 You would add function called "Plugin = INSERT_FUNCTION_HERE"
6015
6016 That's it; If you want other stuff to happen when the gun is fired, you would either put it all into 1 function, or
6017 you would add more Plugins to the "Firing" table. Like so:
6018
6019 Firing = {
6020 Plugin = function()
6021 --Code
6022 end;
6023 Plugin = function()
6024 --Code
6025 end;
6026 Plugin = function()
6027 --Code
6028 end;
6029 };
6030
6031 That's really it, you just need to know some basic scripting to use it. If you have more questions, pm me.
6032
6033 NOTE: The plugins run seperate from the code in the Gun_Main. For example, if you have a plugin that ejects a shell 1 second
6034 after the gun is fired, the gun's firing speed won't be affected in any way.
6035
6036--]]
6037
6038local Gun = script.Parent
6039
6040local Plugins = {
6041
6042 KeyDown = {
6043 { --This is a plugin for a toggleable laser
6044 Key = "v"; --This is the key you press to activate the plugin
6045 Description = "Toggle Laser"; --This is what the description of the key will be in the controls
6046 Plugin = function() --This is the actual plugin function
6047 local Laser = Gun:WaitForChild("Laser") --These few lines wait for the necessary bricks/models
6048 local Handle = Gun:WaitForChild("Handle")
6049 local ignoreCode = Gun.clientMain:WaitForChild("ignoreCode")
6050 local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
6051
6052 local PlyrName = game.Players:GetPlayerFromCharacter(Gun.Parent).Name
6053 local playerFolder = ignoreModel:WaitForChild("gunIgnore_"..PlyrName)
6054
6055 local RS = game:GetService("RunService")
6056
6057 local function createLaserDot() --This function creates the red laser dot
6058 local laserDot = Instance.new("Part")
6059 laserDot.Transparency = 1
6060 laserDot.Name = "laserDot"
6061 laserDot.Anchored = true
6062 laserDot.CanCollide = false
6063 laserDot.FormFactor = Enum.FormFactor.Custom
6064 laserDot.Size = Vector3.new(0.25, 0.25, 1)
6065
6066 local laserGui = Instance.new("SurfaceGui")
6067 laserGui.CanvasSize = Vector2.new(100, 100)
6068 laserGui.Parent = laserDot
6069
6070 local laserImage = Instance.new("ImageLabel")
6071 laserImage.BackgroundTransparency = 1
6072 laserImage.Size = UDim2.new(1, 0, 1, 0)
6073 laserImage.Image = "http://www.roblox.com/asset/?id=131394739"
6074 laserImage.Parent = laserGui
6075
6076 --[[local laserLight = Instance.new("SurfaceLight")
6077 laserLight.Angle = 180
6078 laserLight.Brightness = math.huge
6079 laserLight.Color = Color3.new(1, 0, 0)
6080 laserLight.Face = Enum.NormalId.Back
6081 laserLight.Range = 5
6082 laserLight.Shadows = true
6083 laserLight.Parent = laserDot]]
6084
6085 return laserDot
6086 end
6087
6088 local function getHitSurfaceCFrame(Pos, Obj) --This function returns the proper cframe based on the face that the position is on
6089 local surfaceCF = {
6090 {"Back", Obj.CFrame * CFrame.new(0, 0, Obj.Size.z)};
6091 {"Bottom", Obj.CFrame * CFrame.new(0, -Obj.Size.y, 0)};
6092 {"Front", Obj.CFrame * CFrame.new(0, 0, -Obj.Size.z)};
6093 {"Left", Obj.CFrame * CFrame.new(-Obj.Size.x, 0, 0)};
6094 {"Right", Obj.CFrame * CFrame.new(Obj.Size.x, 0, 0)};
6095 {"Top", Obj.CFrame * CFrame.new(0, Obj.Size.y, 0)}
6096 }
6097 local closestDist = math.huge
6098 local closestSurface = nil
6099 for _,v in pairs(surfaceCF) do
6100 local surfaceDist = (Pos - v[2].p).magnitude
6101 if surfaceDist < closestDist then
6102 closestDist = surfaceDist
6103 closestSurface = v
6104 end
6105 end
6106
6107 local surfaceDir = CFrame.new(Obj.CFrame.p, closestSurface[2].p)
6108 local surfaceDist = surfaceDir.lookVector * ((Obj.CFrame.p - closestSurface[2].p).magnitude / 2 - 0.25)
6109 local surfaceOffset = Pos - closestSurface[2].p + surfaceDist
6110 local surfaceCFrame = surfaceDir + surfaceDist + surfaceOffset
6111
6112 return surfaceCFrame
6113 end
6114
6115 local laserDot = createLaserDot() --The code is cleaner when the laser creating code is in a function
6116
6117 Laser.Transparency = (Laser.Transparency == 1 and 0 or 1) --Toggles the laser on or off
6118
6119 while math.floor(Laser.Transparency) == 0 do --This loop will keep running as long as the laser is visible
6120 if (not game.Players:GetPlayerFromCharacter(Gun.Parent)) then break end --This checks if the gun is a child of the character
6121
6122 local newRay = Ray.new(Laser.Position, Handle.CFrame.lookVector * 999)
6123 local H, P = game.Workspace:FindPartOnRay(newRay, ignoreModel)
6124
6125 local Distance = (P - Laser.Position).magnitude
6126 Laser.Mesh.Offset = Vector3.new(0, Distance / 2, 0)
6127 Laser.Mesh.Scale = Vector3.new(0.075, Distance / 0.2, 0.075)
6128
6129 if H then
6130 laserDot.CFrame = getHitSurfaceCFrame(P, H) --If the laser hits a part then position the dot on the part
6131 laserDot.Parent = playerFolder
6132 else
6133 laserDot.Parent = nil --If the laser doesn't hit a part then temporarily remove the laser dor
6134 end
6135
6136 RS.RenderStepped:wait()
6137 end
6138
6139 laserDot:Destroy() --These lines reset the laser if the laser is transparent or the gun was deselected
6140 Laser.Transparency = 1
6141 Laser.Mesh.Offset = Vector3.new()
6142 Laser.Mesh.Scale = Vector3.new(0.075, 0, 0.075)
6143 end;
6144 };
6145
6146 { --This is a plugin for a toggleable flashlight
6147 Key = "z";
6148 Description = "Toggle Flashlight";
6149 Plugin = function()
6150 local Flashlight = Gun:WaitForChild("Flashlight")
6151 if Flashlight then
6152 for _, Light in pairs(Flashlight:GetChildren()) do
6153 if Light.Name == "Light" then
6154 Light.Enabled = (not Light.Enabled)
6155 Flashlight.Sound:Play()
6156 end
6157 end
6158 end
6159 end
6160 };
6161 };
6162
6163 KeyUp = {
6164
6165 };
6166
6167 Firing = {
6168 Plugin = function()
6169 --Put code here
6170 end;
6171 };
6172
6173 Aimed = {
6174 Plugin = function()
6175 --Put code here
6176 end;
6177 };
6178
6179 UnAimed = {
6180 Plugin = function()
6181 --Put code here
6182 end;
6183 };
6184
6185 OnEquipped = {
6186 Plugin = function()
6187 local EquipSound = Instance.new('Sound')
6188 EquipSound.Name = 'EquippedSound'
6189 EquipSound.SoundId = 'rbxassetid://169799883'
6190 EquipSound.Parent = script.Parent.Handle
6191 EquipSound:Play()
6192 end
6193 };
6194
6195 OnUnEquipped = {
6196 Plugin = function()
6197 local RemoveSound = script.Parent.Handle:WaitForChild('EquippedSound')
6198 RemoveSound:remove()
6199 end
6200 };
6201
6202}
6203
6204return Plugins
6205end))
6206ModuleScript121.Name = "SETTINGS"
6207ModuleScript121.Parent = Tool0
6208table.insert(cors,sandbox(ModuleScript121,function()
6209local Settings = {
6210
6211
6212 gunType = {
6213 Semi = false;
6214 Auto = true;
6215 Burst = false;
6216 Shot = false;
6217 Explosive = false;
6218 };
6219
6220 selectFire = true;
6221 selectFireSettings = {
6222 Animation = true;
6223 GUI = false;
6224 Modes = {
6225 Safety = true;
6226 Semi = false;
6227 Burst = false;
6228 Auto = true;
6229 };
6230 animSpeed = 0.5;
6231 };
6232
6233
6234 burstSettings = {
6235 fireRateBurst = true;
6236 Amount = 3;
6237 Time = 0.2;
6238 Wait = 0.1;
6239 };
6240
6241
6242 shotAmount = 5;
6243
6244
6245 explosionSettings = {
6246 Radius = 20;
6247 Pressure = 5e5;
6248 Type = Enum.ExplosionType.NoCraters;
6249
6250 soundId = "rbxassetid://138499093";
6251 soundPitch = 1;
6252 soundVolume = 1;
6253 rayCastExplosions = false;
6254 rangeBasedDamage = true;
6255 };
6256
6257
6258 playerArms = true;
6259 fakeArmSettings = {
6260 Transparency = 0;
6261 armSize = Vector3.new(0.6, 2, 0.6);
6262 characterMeshes = false;
6263 realBodyColor = true;
6264 Color = BrickColor.new("Pastel brown");
6265 };
6266
6267
6268 unAimedC1 = {
6269 leftArm = CFrame.new(-.5, 1.3, -1.7) * CFrame.Angles(math.rad(-30), -.5, math.rad(-30));
6270 rightArm = CFrame.new(0.4, 0.25, -0.3) * CFrame.Angles(0, 0, math.rad(25));
6271 Grip = CFrame.Angles(0, math.rad(25), 0);
6272 };
6273 aimedC1 = {
6274 leftArm = CFrame.new(-.1, 1.3, -1) * CFrame.Angles(math.rad(-30), -.5, 0) * CFrame.Angles(0, 0, math.rad(-40));
6275 rightArm = CFrame.new(0.5, 0.3, 0.1) * CFrame.Angles(0, 0, math.rad(45));
6276 };
6277 runningC1 = {
6278 leftArm = CFrame.new(-0.8, .9, -1) * CFrame.Angles(math.rad(1), math.rad(-8.5), math.rad(16));
6279 rightArm = CFrame.new(0.16, 1, -0.14) * CFrame.Angles(math.rad(15), math.rad(2), math.rad(50));
6280 Grip = CFrame.Angles(0, math.rad(-5), 0);
6281 };
6282
6283
6284 equipAnimation = true;
6285 equipSettings = {
6286 Time = 0.25;
6287 leftArmC1 = CFrame.new(0.2, 1.2, 0) * CFrame.Angles(math.rad(105), math.rad(-30), math.rad(90));
6288 rightArmC1 = CFrame.new(-0.5, 0.75, 0) * CFrame.Angles(math.rad(45), 0, math.rad(75));
6289 GripC1 = CFrame.new();
6290 };
6291
6292
6293 stopAnimsOnFall = true;
6294 fallAnimation = true;
6295 fallSettings = {
6296 maxDist = 35;
6297 landMultiplier = 1;
6298 fallMultiplier = 1;
6299 aimEffect = 0.25;
6300 };
6301
6302
6303 gunMomentum = true;
6304 momentumSettings = {
6305 maxInput = 18;
6306 Speed = 20;
6307 Damper = 0.5;
6308 Amplitude = {
6309 unAimed = 5;
6310 Aimed = 1;
6311 }
6312 };
6313
6314
6315 cockingAnim = false;
6316 movementAnims = true;
6317
6318
6319 canADS = true;
6320 aimSettings = {
6321 Anim = true;
6322 Speed = 0.3;
6323 FOV = 37;
6324 holdToADS = true;
6325 headTilt = math.rad(25);
6326 };
6327
6328
6329 sensitivitySettings = {
6330 Default = 1;
6331 Aim = 0.3;
6332
6333 scrollToChange = true;
6334 Min = 0.05;
6335 Max = 1;
6336 Increment = 0.05;
6337 };
6338
6339
6340 guiScope = false;
6341 scopeSettings = {
6342 Frequency = {
6343 Idling = 0.7;
6344 Walking = 2;
6345 };
6346 Amplitude = {
6347 Idling = 0.75;
6348 Walking = 0.75;
6349 };
6350 steadyTime = 8;
6351 breathTime = 5;
6352 camSwayOnBreath = 2.5;
6353 unSteadyOnFire = true;
6354 };
6355
6356
6357 roundsPerMin = 600;
6358
6359
6360 bulletSettings = {
6361 instantHit = true;
6362 Range = 900;
6363 Velocity = 540;
6364 Acceleration = 196.2;
6365 Color = BrickColor.new("Bright red");
6366 Transparency = 0;
6367 Size = Vector3.new(0.1, 0.1, 5);
6368 };
6369
6370
6371 damageSettings = {
6372 Start = {
6373 Damage = 36;
6374 Dist = 0.08;
6375 };
6376 End = {
6377 Damage = 19;
6378 Dist = 0.5;
6379 };
6380 Multipliers = {
6381 Chest = 1;
6382 Head = 1.4;
6383 Limbs = 1;
6384 };
6385 };
6386
6387
6388 AllowFriendlyFire = false;
6389 CanDamageNPCs = true;
6390
6391 bulletTrail = false;
6392 trailSettings = {
6393 Color = BrickColor.new("White");
6394 Transparency = 0;
6395 Thickness = 0;
6396 visibleTime = 0;
6397 disappearTime = 0;
6398 };
6399
6400
6401 bulletHoles = true;
6402 holeSettings = {
6403 Texture = "http://www.roblox.com/asset/?id=64291961";
6404 Size = 0.5;
6405 visibleTime = 3;
6406 disappearTime = 1;
6407 };
6408
6409
6410 bulletSparks = true;
6411 customSparks = false;
6412 sparkSettings = {
6413 Color = {
6414 Start = Color3.new(1, 158 / 255, 24 / 255);
6415 End = Color3.new(212 / 255, 242 / 255, 8 / 255);
6416 };
6417 Size = 0.25;
6418 Texture = "http://www.roblox.com/asset/?id=311395391";
6419 Lifetime = 0.2;
6420 Rate = 75;
6421 Speed = 25;
6422 Spread = 45;
6423 Materials = {
6424 Enum.Material.Plastic;
6425 Enum.Material.Slate;
6426 Enum.Material.Concrete;
6427 Enum.Material.CorrodedMetal;
6428 Enum.Material.DiamondPlate;
6429 Enum.Material.Foil;
6430 Enum.Material.Marble;
6431 Enum.Material.Granite;
6432 Enum.Material.Brick;
6433 Enum.Material.Pebble;
6434 Enum.Material.SmoothPlastic;
6435 Enum.Material.Metal;
6436 Enum.Material.Cobblestone;
6437 };
6438 };
6439
6440
6441 bulletSmoke = false;
6442 smokeSettings = {
6443 objColor = false;
6444 Color = Color3.new(0.5, 0.5, 0.5);
6445 Size = {
6446 Start = 0.25;
6447 End = 0.5;
6448 };
6449 Texture = "http://www.roblox.com/asset/?id=244514423";
6450 startTransparency = 0;
6451 Lifetime = 0.2;
6452 Rate = 100;
6453 Speed = 35;
6454 Spread = 15;
6455 };
6456
6457
6458 bloodEffect = true;
6459 bloodSettings = {
6460 Color = Color3.new(1, 0, 0);
6461 Size = 0.1;
6462 Texture = "http://www.roblox.com/asset/?id=3419963";
6463 startTransparency = 0.125;
6464 Lifetime = 0.1;
6465 Rate = 200;
6466 Speed = 50;
6467 Spread = 15;
6468 };
6469
6470
6471 bulletShockwave = false;
6472 shockwaveSettings = {
6473 Radius = 0.3;
6474 Color = BrickColor.new("Light stone grey");
6475 Duration = 0.2;
6476 };
6477
6478
6479 penetrationSettings = {
6480 Dist = 0;
6481 transparencyThreshold = 1;
6482 ignoreNonCanCollide = true;
6483 ignoreCustom = {};
6484 };
6485
6486
6487 recoilSettings = {
6488 firstShotMultiplier = 2.4;
6489 aimedMultiplier = 0.5;
6490 camMultiplier = 2;
6491 springSpeed = 15;
6492 springDamper = 0.5;
6493 Recoil = {
6494 Side = {
6495 Left = -0.17;
6496 Right = 0.28;
6497 };
6498 Up = {
6499 Min = 0.26;
6500 Max = 0.28;
6501 };
6502 Back = {
6503 Min = 0.3;
6504 Max = 0.35;
6505 };
6506 Tilt = {
6507 Left = -0.5;
6508 Right = 0.5;
6509 };
6510 }
6511 };
6512
6513
6514 spreadSettings = {
6515 Increase = 0.1;
6516 Decrease = 15;
6517
6518 Aimed = {
6519 Stand = {
6520 Idling = 0.2;
6521 Moving = 0.4;
6522 };
6523 Crouch = {
6524 Idling = 0.15;
6525 Moving = 0.3;
6526 };
6527 Prone = {
6528 Idling = 0.1;
6529 Moving = 0.3;
6530 };
6531 };
6532 unAimed = {
6533 Stand = {
6534 Idling = 2;
6535 Moving = 2.5;
6536 };
6537 Crouch = {
6538 Idling = 1.5;
6539 Moving = 2;
6540 };
6541 Prone = {
6542 Idling = 1;
6543 Moving = 2;
6544 };
6545 };
6546 };
6547
6548
6549 reloadSettings = {
6550 Anim = true;
6551 Times = {
6552 Loaded = 1.85;
6553 Empty = 2.4;
6554 };
6555 autoReload = true;
6556 magIsBullet = false;
6557 reloadWhileRunning = true;
6558 };
6559
6560
6561 sprintTime = 15;
6562 staminaCoolTime = 4;
6563 canFireWhileRunning = false;
6564
6565
6566 dolphinDive = true;
6567 diveSettings = {
6568 rechargeTime = 1;
6569 Force = 350;
6570 Angle = math.rad(30);
6571 };
6572
6573
6574 canChangeStance = true;
6575 stanceSettings = {
6576 Anim = true;
6577 Speed = 0.3;
6578 Stances = {
6579 Crouch = true;
6580 Prone = true;
6581 };
6582 standOnDeselect = true;
6583 crawlAnimation = true;
6584 };
6585
6586
6587 walkSpeeds = {
6588 Base = 16;
6589 Sprinting = 25;
6590 Aimed = 10;
6591 Crouched = 7;
6592 Prone = 4;
6593 };
6594
6595
6596 --NOTE: For extra keys, go here: http://wiki.roblox.com/index.php?title=Taking_keyboard_input
6597 Keys = {
6598 lowerStance = "c";
6599 raiseStance = "x";
6600 selectFire = "f";
6601 Reload = "r";
6602 Sprint = string.char(48);
6603 ADS = "q";
6604 scopeSteady = string.char(48);
6605 };
6606
6607
6608}
6609
6610return Settings
6611end))
6612MeshPart122.Name = "BoltBack"
6613MeshPart122.Parent = Tool0
6614MeshPart122.CFrame = CFrame.new(4.38773298, 1.38872302, -45.1271095, -0.0322783664, -2.30222653e-07, 0.999484539, 2.18771206e-07, 1, 2.37406567e-07, -0.999484539, 2.26316672e-07, -0.0322783664)
6615MeshPart122.Orientation = Vector3.new(0, 91.8499985, 0)
6616MeshPart122.Position = Vector3.new(4.38773298, 1.38872302, -45.1271095)
6617MeshPart122.Rotation = Vector3.new(-180, 88.1600037, 180)
6618MeshPart122.Color = Color3.new(0.105882, 0.164706, 0.207843)
6619MeshPart122.Transparency = 1
6620MeshPart122.Size = Vector3.new(0.240676701, 0.200000003, 0.976980329)
6621MeshPart122.Anchored = true
6622MeshPart122.BrickColor = BrickColor.new("Black")
6623MeshPart122.CanCollide = false
6624MeshPart122.Material = Enum.Material.Metal
6625MeshPart122.brickColor = BrickColor.new("Black")
6626MeshPart122.TextureID = "rbxassetid://430310377"
6627Camera123.Name = "ThumbnailCamera"
6628Camera123.Parent = Tool0
6629Camera123.CFrame = CFrame.new(101.983742, 0.838684142, -38.4423218, -0.785091221, 0.0226724707, 0.618965149, -0, 0.999329865, -0.0366050899, -0.619380295, -0.0287383348, -0.784564972)
6630Camera123.CoordinateFrame = CFrame.new(101.983742, 0.838684142, -38.4423218, -0.785091221, 0.0226724707, 0.618965149, -0, 0.999329865, -0.0366050899, -0.619380295, -0.0287383348, -0.784564972)
6631Camera123.FieldOfView = 40
6632Camera123.Focus = CFrame.new(100.745811, 0.911894321, -36.8731918, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6633Camera123.HeadLocked = false
6634Camera123.focus = CFrame.new(100.745811, 0.911894321, -36.8731918, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6635for i,v in pairs(mas:GetChildren()) do
6636 v.Parent = workspace
6637 pcall(function() v:MakeJoints() end)
6638end
6639mas:Destroy()
6640for i,v in pairs(cors) do
6641 spawn(function()
6642 pcall(v)
6643 end)
6644end