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