function tweenFoV(J,q)coroutine.resume(coroutine.create(function()SFn=SFn and SFn+1 or 0 local Y=SFn for d=1,q,1 do if SFn~=Y then break end Camera.FieldOfView=Camera.FieldOfView+(J-Camera.FieldOfView)*(d/q);(game:GetService("\082\117\110\083\101\114\118\105\099\101")).RenderStepped:wait()end end))end function Lerp(J,q,Y)return J+(q-J)*Y end local J=game:GetService("\082\117\110\083\101\114\118\105\099\101")function tweenJoint(q,Y,d,Q,G)spawn(function()local P=math.random(-1000000000.0,1000000000.0)local g=nil if not q:findFirstChild("\116\119\101\101\110\067\111\100\101")then g=Instance.new("\073\110\116\086\097\108\117\101")g.Name="\116\119\101\101\110\067\111\100\101"g.Value=P g.Parent=q else g=q.tweenCode g.Value=P end if G<=0 then if Y then q.C0=Y end if d then q.C1=d end else local t=1.5/G local X=q.C0 local L=q.C1 local N=0 while true do J.RenderStepped:wait()local G=N+t N=G>90 and 90 or G if g.Value~=P then break end if not Equipped then break end if Y then q.C0=X:lerp(Y,Q(N))end if d then q.C1=L:lerp(d,Q(N))end if N==90 then break end end end if g.Value==P then g:Destroy()end end)end function LoadClientMods()for J,q in pairs(GunMods:GetChildren())do if q:IsA("\076\111\099\097\108\083\099\114\105\112\116")then local J=q:clone()J.Parent=ModStorageFolder J.Disabled=false end end end function UnloadClientMods()for J,q in pairs(ModStorageFolder:GetChildren())do if q:IsA("\076\111\099\097\108\083\099\114\105\112\116")then q:Destroy()end end end function CheckForHumanoid(J)local q=false local Y=nil if J then if J.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")or J.Parent.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")then q=true if J.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")then Y=J.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")elseif J.Parent.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")then Y=J.Parent.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")end else q=false end end return q,Y end function CreateShell()delay(math.random(4,8)/10,function()if PastaFX:FindFirstChild("\083\104\101\108\108\067\097\115\105\110\103")then local J=PastaFX.ShellCasing:clone()J.Parent=Jogador.PlayerGui J.PlaybackSpeed=math.random(30,50)/40 J.PlayOnRemove=true Debris:AddItem(J,0)end end)end local q=1 function TracerCalculation()local J if Settings.RandomTracer then if math.random(1,100)<=Settings.TracerChance then J=true else J=false end else if q>=Settings.TracerEveryXShots then J=true q=1 else q=q+1 end end return J end function CreateBullet(J)local q=Instance.new("\080\097\114\116")q.Name=Player.Name.."\095\066\117\108\108\101\116"q.CanCollide=false q.Transparency=1 q.FormFactor="\067\117\115\116\111\109"q.Size=Vector3.new(1,1,1)local Y=q:GetMass()local d=Vector3.new(0,Y*196.2-Settings.BDrop*196.2,0)local Q=Instance.new("\066\111\100\121\070\111\114\099\101")Q.force=d Q.Parent=q local G=ArmaClone.SmokePart.Position local P=ArmaClone.SmokePart.CFrame.lookVector+(ArmaClone.SmokePart.CFrame.upVector*(((Settings.BDrop*Zeroing.Value)/2.8)/Settings.BSpeed))/2 local g=CFrame.new(G,G+P)local t=CFrame.Angles(RAD(RAND(-J-(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier,J+(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)/20),RAD(RAND(-J-(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier,J+(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)/20),RAD(RAND(-J-(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier,J+(SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)/20))P=t*P q.Parent=BulletModel q.CFrame=g+P q.Velocity=P*Settings.BSpeed local X=Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))local L=TracerCalculation()if Settings.BulletFlare==true and L then local J=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105",q)J.Adornee=q J.Enabled=false local Y=math.random(275,375)/10 J.Size=UDim2.new(Y,0,Y,0)J.LightInfluence=0 local d=Instance.new("\073\109\097\103\101\076\097\098\101\108",J)d.BackgroundTransparency=1 d.Size=UDim2.new(1,0,1,0)d.Position=UDim2.new(0,0,0,0)d.Image="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\048\052\055\048\054\054\052\048\053"if Settings.RainbowMode==true then d.ImageColor3=X else d.ImageColor3=Settings.BulletFlareColor end d.ImageTransparency=math.random(2,5)/15 spawn(function()wait(.2)if q:FindFirstChild("\066\105\108\108\098\111\097\114\100\071\117\105")~=nil then q.BillboardGui.Enabled=true end end)end if Settings.Tracer==true and L then local J=Instance.new("\065\116\116\097\099\104\109\101\110\116")J.Name="\065\116\049"J.Position=Vector3.new(-Settings.TracerWidth,0,0)J.Parent=q local Y=Instance.new("\065\116\116\097\099\104\109\101\110\116")Y.Name="\065\116\050"Y.Position=Vector3.new(Settings.TracerWidth,0,0)Y.Parent=q local d=Instance.new("\084\114\097\105\108")d.Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,0,0),NumberSequenceKeypoint.new(1,1)})d.WidthScale=NumberSequence.new({NumberSequenceKeypoint.new(0,2,0);NumberSequenceKeypoint.new(1,1)})if Settings.RainbowMode==true then d.Color=ColorSequence.new(X)else d.Color=ColorSequence.new(Settings.TracerColor)end d.Texture="\114\098\120\097\115\115\101\116\105\100\058\047\047\050\051\050\057\049\056\054\050\050"d.TextureMode=Enum.TextureMode.Stretch d.FaceCamera=true d.LightEmission=Settings.TracerLightEmission d.LightInfluence=Settings.TracerLightInfluence d.Lifetime=Settings.TracerLifeTime d.Attachment0=J d.Attachment1=Y d.Parent=q end if Settings.BulletLight==true and L then local J=Instance.new("\080\111\105\110\116\076\105\103\104\116")J.Parent=q J.Brightness=Settings.BulletLightBrightness if Settings.RainbowMode==true then J.Color=X else J.Color=Settings.BulletLightColor end J.Range=Settings.BulletLightRange J.Shadows=true end CreateShell()if L then if ServerConfig.ReplicatedBullets then Evt.ServerBullet:FireServer(g,Settings.Tracer,Settings.BDrop,Settings.BSpeed,P,Settings.TracerColor,Ray_Ignore,Settings.BulletFlare,Settings.BulletFlareColor)end end game.Debris:AddItem(q,5)return q end function CalcularDano(J,q,Y,d)local Q=0 local G=0 local P=0 local g=J-(math.ceil(q)/40)*Settings.FallOfDamage if Y.Parent:FindFirstChild("\083\097\117\100\101")~=nil then local J=Y.Parent.Saude.Protecao.VestVida local q=Y.Parent.Saude.Protecao.VestProtect local t=Y.Parent.Saude.Protecao.HelmetVida local X=Y.Parent.Saude.Protecao.HelmetProtect if d=="\072\101\097\100"then if t.Value>0 and Settings.BulletPenetration<X.Value then Q=g*(Settings.BulletPenetration/X.Value)P=g*((100-Settings.BulletPenetration)/X.Value)if P<=0 then P=.5 end elseif t.Value>0 and Settings.BulletPenetration>=X.Value then Q=g P=g*((100-Settings.BulletPenetration)/X.Value)if P<=0 then P=1 end elseif t.Value<=0 then Q=g end else if J.Value>0 and Settings.BulletPenetration<q.Value then Q=g*(Settings.BulletPenetration/q.Value)G=g*((100-Settings.BulletPenetration)/q.Value)if G<=0 then G=.5 end elseif J.Value>0 and Settings.BulletPenetration>=q.Value then Q=g G=g*((100-Settings.BulletPenetration)/q.Value)if G<=0 then G=1 end elseif J.Value<=0 then Q=g end end else Q=g end if Q<=0 then Q=1 end return Q,G,P end local Y={"\051\052\050\049\057\048\048\048\053";"\051\052\050\049\057\048\048\049\050";"\051\052\050\049\057\048\048\049\055","\051\052\050\049\057\048\048\050\052"}Evt.Whizz.OnClientEvent:connect(function()local J=Instance.new("\083\111\117\110\100")J.Parent=Jogador.PlayerGui J.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047"..Y[math.random(1,4)]J.Volume=2 J.PlayOnRemove=true J:Destroy()end)Evt.Suppression.OnClientEvent:Connect(function(J,q,Y)if ServerConfig.EnableStatusUI and(Jogador.Character and Human.Health>0)then if J==1 then(TS:Create(StatusClone.Efeitos.Suppress,TweenInfo.new(.1),{ImageTransparency=0;Size=UDim2.fromScale(1,1.15)})):Play()delay(.1,function()(TS:Create(StatusClone.Efeitos.Suppress,TweenInfo.new(1,Enum.EasingStyle.Exponential,Enum.EasingDirection.InOut,0,false,.15),{ImageTransparency=1;Size=UDim2.fromScale(2,2)})):Play()end)else end end end)function CastRay(q)local Y,d,Q,G local P,g,t,X local L=ArmaClone.SmokePart.Position local N=q.Position local s=0 local v=false local f while true do J.Heartbeat:wait()N=q.Position s=s+(N-L).magnitude Y,d,Q,G=workspace:FindPartOnRayWithIgnoreList(Ray.new(L,(N-L)*20),Ray_Ignore,false,true)P,g,t,X=workspace:FindPartOnRayWithIgnoreList(Ray.new(L,N-L),Ray_Ignore,false,true)for J,q in pairs(game.Players:GetChildren())do if q:IsA("\080\108\097\121\101\114")and(q~=Player and(q.Character and(q.Character:FindFirstChild("\072\101\097\100")and((q.Character.Head.Position-g).magnitude<=Settings.SuppressMaxDistance and(Settings.BulletWhiz and not v)))))then Evt.Whizz:FireServer(q)Evt.Suppression:FireServer(q)v=true end end if s>Settings.Distance then q:Destroy()v=true break end if Y then while not f do if Y and((Y and Y.Transparency>=1 or Y.CanCollide==false or Y.Name=="\073\103\110\111\114\097\098\108\101"or Y.Name=="\071\108\097\115\115"or Y.Parent.Name=="\084\111\112"or Y.Parent.Name=="\072\101\108\109\101\116"or Y.Parent.Name=="\085\112"or Y.Parent.Name=="\068\111\119\110"or Y.Parent.Name=="\070\097\099\101"or Y.Parent.Name=="\079\108\104\111"or Y.Parent.Name=="\072\101\097\100\115\101\116"or Y.Parent.Name=="\078\117\109\101\114\111"or Y.Parent.Name=="\086\101\115\116"or Y.Parent.Name=="\067\104\101\115\116"or Y.Parent.Name=="\087\097\105\115\116"or Y.Parent.Name=="\066\097\099\107"or Y.Parent.Name=="\066\101\108\116"or Y.Parent.Name=="\076\101\103\049"or Y.Parent.Name=="\076\101\103\050"or Y.Parent.Name=="\065\114\109\049"or Y.Parent.Name=="\065\114\109\050")and(Y.Name~="\082\105\103\104\116 \065\114\109"and(Y.Name~="\076\101\102\116 \065\114\109"and(Y.Name~="\082\105\103\104\116 \076\101\103"and(Y.Name~="\076\101\102\116 \076\101\103"and(Y.Name~="\065\114\109\111\114"and Y.Name~="\069\083\104\105\101\108\100"))))))then table.insert(Ray_Ignore,Y)f=true end if f then Y,d,Q,G=workspace:FindPartOnRayWithIgnoreList(Ray.new(L,(N-L)*20),Ray_Ignore,false,true)P,g,t,X=workspace:FindPartOnRayWithIgnoreList(Ray.new(L,N-L),Ray_Ignore,false,true)f=false else break end end end if P and not f then q:Destroy()v=true local J,Y=CheckForHumanoid(P)Hitmarker.HitEffect(Ray_Ignore,ACS_Storage,g,P,t,X,Settings)Evt.Hit:FireServer(g,P,t,X,Settings,s)if J==true and Y.Health>0 then if ServerConfig.HitmarkerSound then local J=PastaFX.Hitmarker:Clone()J.Parent=Player.PlayerGui J.Volume=2 J.PlayOnRemove=true Debris:AddItem(J,0)end if not Settings.ModoTreino then Evt.CreateOwner:FireServer(Y)if game.Players:FindFirstChild(Y.Parent.Name)==nil then if P.Name=="\072\101\097\100"then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\084\111\114\115\111"or P.Parent.Name=="\085\112\112\101\114\084\111\114\115\111"or P.Parent.Name=="\076\111\119\101\114\084\111\114\115\111"then local J=math.random(Settings.TorsoDamage[1],Settings.TorsoDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)else local J=math.random(Settings.LimbsDamage[1],Settings.LimbsDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)end else if not ServerConfig.TeamKill then if game.Players:FindFirstChild(Y.Parent.Name)and(game.Players:FindFirstChild(Y.Parent.Name)).Team~=Player.Team or game.Players:FindFirstChild(Y.Parent.Name)==nil then if P.Name=="\072\101\097\100"or P.Parent.Name=="\084\111\112"or P.Parent.Name=="\072\101\097\100\115\101\116"or P.Parent.Name=="\079\108\104\111"or P.Parent.Name=="\070\097\099\101"or P.Parent.Name=="\078\117\109\101\114\111"then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Parent:IsA("\065\099\099\101\115\115\111\114\121")or P.Parent:IsA("\072\097\116")then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\084\111\114\115\111"or P.Parent.Name=="\067\104\101\115\116"or P.Parent.Name=="\087\097\105\115\116"then local J=math.random(Settings.TorsoDamage[1],Settings.TorsoDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\082\105\103\104\116 \065\114\109"or P.Name=="\082\105\103\104\116 \076\101\103"or P.Name=="\076\101\102\116 \076\101\103"or P.Name=="\076\101\102\116 \065\114\109"then local J=math.random(Settings.LimbsDamage[1],Settings.LimbsDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)end end else if game.Players:FindFirstChild(Y.Parent.Name)and(game.Players:FindFirstChild(Y.Parent.Name)).Team~=Player.Team or game.Players:FindFirstChild(Y.Parent.Name)==nil then if P.Name=="\072\101\097\100"or P.Parent.Name=="\084\111\112"or P.Parent.Name=="\072\101\097\100\115\101\116"or P.Parent.Name=="\079\108\104\111"or P.Parent.Name=="\070\097\099\101"or P.Parent.Name=="\078\117\109\101\114\111"then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Parent:IsA("\065\099\099\101\115\115\111\114\121")or P.Parent:IsA("\072\097\116")then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\084\111\114\115\111"or P.Parent.Name=="\067\104\101\115\116"or P.Parent.Name=="\087\097\105\115\116"then local J=math.random(Settings.TorsoDamage[1],Settings.TorsoDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\082\105\103\104\116 \065\114\109"or P.Name=="\082\105\103\104\116 \076\101\103"or P.Name=="\076\101\102\116 \076\101\103"or P.Name=="\076\101\102\116 \065\114\109"then local J=math.random(Settings.LimbsDamage[1],Settings.LimbsDamage[2])local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)end else if P.Name=="\072\101\097\100"or P.Parent.Name=="\084\111\112"or P.Parent.Name=="\072\101\097\100\115\101\116"or P.Parent.Name=="\079\108\104\111"or P.Parent.Name=="\070\097\099\101"or P.Parent.Name=="\078\117\109\101\114\111"then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])*ServerConfig.TeamDamageMultiplier local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Parent:IsA("\065\099\099\101\115\115\111\114\121")or P.Parent:IsA("\072\097\116")then local J=math.random(Settings.HeadDamage[1],Settings.HeadDamage[2])*ServerConfig.TeamDamageMultiplier local q,d,Q=CalcularDano(J,s,Y,"\072\101\097\100")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\084\111\114\115\111"or P.Parent.Name=="\067\104\101\115\116"or P.Parent.Name=="\087\097\105\115\116"then local J=math.random(Settings.TorsoDamage[1],Settings.TorsoDamage[2])*ServerConfig.TeamDamageMultiplier local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)elseif P.Name=="\082\105\103\104\116 \065\114\109"or P.Name=="\082\105\103\104\116 \076\101\103"or P.Name=="\076\101\102\116 \076\101\103"or P.Name=="\076\101\102\116 \065\114\109"then local J=math.random(Settings.LimbsDamage[1],Settings.LimbsDamage[2])*ServerConfig.TeamDamageMultiplier local q,d,Q=CalcularDano(J,s,Y,"\066\111\100\121")Evt.Damage:FireServer(Y,q,d,Q)end end end end else if P.Name=="\072\101\097\100"or P.Parent.Name=="\084\111\112"or P.Parent.Name=="\072\101\097\100\115\101\116"or P.Parent.Name=="\079\108\104\111"or P.Parent.Name=="\070\097\099\101"or P.Parent.Name=="\078\117\109\101\114\111"or P.Parent:IsA("\065\099\099\101\115\115\111\114\121")or P.Parent:IsA("\072\097\116")or P.Name=="\084\111\114\115\111"or P.Parent.Name=="\067\104\101\115\116"or P.Parent.Name=="\087\097\105\115\116"or P.Name=="\082\105\103\104\116 \065\114\109"or P.Name=="\076\101\102\116 \065\114\109"or P.Name=="\082\105\103\104\116 \076\101\103"or P.Name=="\076\101\102\116 \076\101\103"or P.Parent.Name=="\066\097\099\107"or P.Parent.Name=="\076\101\103\049"or P.Parent.Name=="\076\101\103\050"or P.Parent.Name=="\065\114\109\049"or P.Parent.Name=="\065\114\109\050"then Evt.Treino:FireServer(Y)end end break end end L=N end end Human.Running:connect(function(J)if Equipped then SpeedPrecision=J Sprint()if J>1 then Walking=true else Walking=false end end end)Mouse.KeyDown:connect(function(J)if Equipped then if J=="\119"then if not w then w=true end end if J=="\097"then if not a then a=true end end if J=="\115"then if not s then s=true end end if J=="\100"then if not d then d=true end end end end)Mouse.KeyUp:connect(function(J)if Equipped then if J=="\119"then if w then w=false end end if J=="\097"then if a then a=false end end if J=="\115"then if s then s=false end end if J=="\100"then if d then d=false end end end end)function SlideEx()tweenJoint(ArmaClone.Handle:WaitForChild("\083\108\105\100\101"),CFrame.new(Settings.SlideExtend)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))if Settings.MoveBolt==true then tweenJoint(ArmaClone.Handle:WaitForChild("\066\111\108\116"),CFrame.new(Settings.BoltExtend)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))end delay(FireRate/2,function()if Ammo.Value>=1 then tweenJoint(ArmaClone.Handle:WaitForChild("\083\108\105\100\101"),CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))if Settings.MoveBolt==true then tweenJoint(ArmaClone.Handle:WaitForChild("\066\111\108\116"),CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))end elseif Ammo.Value<1 and Settings.SlideLock==true then Chambered.Value=false if Settings.MoveBolt==true and Settings.BoltLock==false then tweenJoint(ArmaClone.Handle:WaitForChild("\066\111\108\116"),CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))end ArmaClone.Handle.Click:Play()slideback=true elseif Ammo.Value<1 and Settings.SlideLock==false then tweenJoint(ArmaClone.Handle:WaitForChild("\083\108\105\100\101"),CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))if Settings.MoveBolt==true then tweenJoint(ArmaClone.Handle:WaitForChild("\066\111\108\116"),CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(0),0),nil,function(J)return math.sin(math.rad(J))end,1*(FireRate/2))end Chambered.Value=false ArmaClone.Handle.Click:Play()end end)end function recoil()spawn(function()if Bipod then local J=VRecoil/5 local q=(HRecoil*math.random(-1,1))/5 Camera.CFrame=Camera.CFrame*CFrame.Angles(J,q,0)local Y=-J/30 local d=-q/30 local Q local G=Q local P if Settings.GunType==0 then P=VPunchBase else P=(VPunchBase*10)/100 end local g=math.random(-HPunchBase*25,HPunchBase*25)/100 local t=DPunchBase*math.random(-1,1)if not Aiming then Recoil=Recoil:lerp((Recoil*CFrame.new(0,0,Settings.RecoilPunch/2))*CFrame.Angles(RAD((P*RecoilPower)*.25),RAD((g*RecoilPower)*.25),RAD((t*RecoilPower)*.25)),1)else Recoil=Recoil:lerp((Recoil*CFrame.new(0,0,Settings.RecoilPunch/2))*CFrame.Angles(RAD((P*RecoilPower)*.25),RAD((g*RecoilPower)*.25),RAD((t*RecoilPower)*.25)),1)end for J=1,30,1 do if G==Q then Camera.CoordinateFrame=((CFrame.new(Camera.Focus.p)*(Camera.CoordinateFrame-Camera.CoordinateFrame.p))*CFrame.Angles(Y,d,0))*CFrame.new(0,0,(Camera.Focus.p-Camera.CoordinateFrame.p).magnitude)wait()else break end end else local J=VRecoil local q=HRecoil*math.random(-1,1)Camera.CFrame=Camera.CFrame*CFrame.Angles(J,q,0)local Y=-J/30 local d=-q/30 local Q local G=Q local P if Settings.GunType==0 then P=VPunchBase else P=math.random(-VPunchBase*50,VPunchBase*100)/100 end local g=math.random(-HPunchBase*100,HPunchBase*100)/100 local t=DPunchBase*math.random(-1,1)if not Aiming then Recoil=Recoil:lerp((Recoil*CFrame.new(0,0,Settings.RecoilPunch))*CFrame.Angles(RAD(P*RecoilPower),RAD(g*RecoilPower),RAD(t*RecoilPower)),1)else Recoil=Recoil:lerp((Recoil*CFrame.new(0,0,Settings.RecoilPunch/2))*CFrame.Angles(RAD((P*RecoilPower)/Settings.AimRecoilReduction),RAD((g*RecoilPower)/Settings.AimRecoilReduction),RAD((t*RecoilPower)/Settings.AimRecoilReduction)),1)end for J=1,30*Settings.AimRecover,1 do if G==Q then Camera.CoordinateFrame=((CFrame.new(Camera.Focus.p)*(Camera.CoordinateFrame-Camera.CoordinateFrame.p))*CFrame.Angles(Y,d,0))*CFrame.new(0,0,(Camera.Focus.p-Camera.CoordinateFrame.p).magnitude)wait()else break end end end end)for J,q in pairs(ArmaClone.SmokePart:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=true end end for J,q in pairs(ArmaClone.Chamber:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=true end end delay(.033333333333333,function()for J,q in pairs(ArmaClone.SmokePart:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=false end end for J,q in pairs(ArmaClone.Chamber:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=false end end end)if Silencer.Value==true then(((Character:WaitForChild("\083"..ArmaClone.Name)):WaitForChild("\071\114\105\112")):WaitForChild("\083\117\112\114\101\115\115\111\114")):Play()else(((Character:WaitForChild("\083"..ArmaClone.Name)):WaitForChild("\071\114\105\112")):WaitForChild("\070\105\114\101")):Play();(((Character:WaitForChild("\083"..ArmaClone.Name)):WaitForChild("\071\114\105\112")):WaitForChild("\069\099\104\111")):Play()end SlideEx()end function Emperrar()if Settings.CanBreak==true and(Chambered.Value==true and Ammo.Value-1>0)then local J=math.random(Settings.JamChance)if J<=2 then Emperrado.Value=true;(ArmaClone.Handle:WaitForChild("\067\108\105\099\107")):Play()end end end function HalfStepFunc(J)if PlaceHolder then Offset=Human.CameraOffset Evt.HeadRot:FireServer(J,Offset,Equipped)end PlaceHolder=not PlaceHolder end oldtick=tick()xTilt=0 yTilt=0 lastPitch=0 lastYaw=0 local Q=0 local G=nil Personagem.ChildAdded:connect(function(J)if J:IsA("\084\111\111\108")and(J:FindFirstChild("\065\067\083\095\077\111\100\117\108\111")and(J.ACS_Modulo:FindFirstChild("\065\067\083\095\083\101\116\117\112")and(Humanoid.Health>0 and(not ToolEquip and(require(J.ACS_Modulo.ACS_Setup)).Type=="\071\117\110"))))then local q=true if(Personagem:WaitForChild("\072\117\109\097\110\111\105\100")).Sit and Personagem.Humanoid.SeatPart:IsA("\086\101\104\105\099\108\101\083\101\097\116")or(Personagem:WaitForChild("\072\117\109\097\110\111\105\100")).Sit and Personagem.Humanoid.SeatPart:IsA("\086\101\104\105\099\108\101\083\101\097\116")or Nadando then q=false end if q then G=J if not Equipped then uis.MouseIconEnabled=false Player.CameraMode=Enum.CameraMode.LockFirstPerson Setup(J)LoadClientMods()Ray_Ignore={Character,Ignore_Model;Camera,BulletModel}Gui=StatusClone:WaitForChild("\071\117\110\072\085\068")Gui.Visible=true CanUpdateGui=true Update_Gui()EquipAnim()if Settings.ZoomAnim and AimPartMode==2 then ZoomAnim()end Sprint()elseif Equipped then Unset()Setup(G)LoadClientMods()end end end end)Human.Seated:Connect(function(J,q)if J and q:IsA("\086\101\104\105\099\108\101\083\101\097\116")then Unset()Humanoid:UnequipTools()Jogador.CameraMaxZoomDistance=ServerConfig.VehicleMaxZoom else Jogador.CameraMaxZoomDistance=game.StarterPlayer.CameraMaxZoomDistance end end)Jogador.Backpack.ChildRemoved:connect(function(J)Evt.Holster:FireServer(J)end)Personagem.ChildRemoved:connect(function(J)if J==ArmaClient then if Equipped then if Balinha then Balinha:Destroy()end Unset()end end end)J.RenderStepped:connect(function(J)if not Equipped then HeadBase.CFrame=Camera.CFrame*CFrame.new(0,0,-0.5)else Update_Gui()HalfStepFunc(-math.asin(Camera.CoordinateFrame.lookVector.y))Recoil=Recoil:lerp(CFrame.new(),Settings.PunchRecover)local J=Ray.new(ArmaClone.Handle.Position,Camera.CFrame.LookVector*Settings.GunSize)local q,Y=workspace:FindPartOnRayWithIgnoreList(J,Ray_Ignore,false,true)local G=Camera.CoordinateFrame.lookVector local P=G.X local g=G.Y local X=G.Z local L,N=math.asin(g),-math.atan(P/X)local s=lastPitch-L local v=lastYaw-N s=s*(math.abs(s)<1 and 1 or 0)v=v*(math.abs(v)<1 and 1 or 0)yTilt=yTilt*.5+s xTilt=xTilt*.5+v lastPitch=L lastYaw=N sway.t=V3(xTilt,yTilt,Q)local f=sway.p local C=f.z local e=f.X*5 local F=f.Y*5 local R=SIN(t*3)*((SpeedPrecision/ServerConfig.RunWalkSpeed)*(WVal+1))local U=COS(t*3)*((SpeedPrecision/ServerConfig.RunWalkSpeed)*(WVal+1))local I=SIN(t*1.75)*((SpeedPrecision/ServerConfig.RunWalkSpeed)*(WVal+1))local r=COS(t*3.5)*((SpeedPrecision/ServerConfig.RunWalkSpeed)*(WVal+1))local c=WVal Walk.t=Vector3.new(R,U,WVal)local W=Walk.p local y=W.X/3 local E=W.Y/3 local V=W.Z/10 local A=W.X/1 local O=W.Y/1 if Clone then if Aiming then c=0 else c=WVal end if Walking then WalkRate=Human.WalkSpeed/3 if a then Q=Lerp(0,(-0.2*SpeedPrecision)/ServerConfig.RunWalkSpeed,10)elseif d then Q=Lerp(0,(.2*SpeedPrecision)/ServerConfig.RunWalkSpeed,10)else Q=Lerp(0,0,10)end else WalkRate=SpeedPrecision/ServerConfig.RunWalkSpeed+.5 WVal=Lerp(0,0,10)end local J=tick()t=t+(J-OldTick)*WalkRate OldTick=J local q=CFa(F*RAD(5),-e*RAD(5),-e*RAD(0))Waval=Waval:lerp(((CFn(A/220,-O/180,0)*CFn(I/220,-r/180,0))*CFa(0,0,V/5))*CFa(0,0,(C/2)/10),1)Clone.C0=Clone.C0:lerp(Waval*q,1)end if OverHeat and Can_Shoot then delay(5,function()if Can_Shoot then OverHeat=false end end)end if BSpread then local J=time()if J-LastSpreadUpdate>FireRate*2 then LastSpreadUpdate=J BSpread=math.max(Settings.MinSpread,BSpread-Settings.AimInaccuracyStepAmount/5)RecoilPower=math.max(Settings.MinRecoilPower,RecoilPower-Settings.RecoilPowerStepAmount/4)end end if OverHeat then ArmaClone.SmokePart.OverHeat.Enabled=true else ArmaClone.SmokePart.OverHeat.Enabled=false end if Aiming then if not NVG or ArmaClone.AimPart:FindFirstChild("\078\086\065\105\109")==nil then if AimPartMode==1 and ArmaClone:FindFirstChild("\065\105\109\080\097\114\116\050")~=nil then Clone.C1=Clone.C1:Lerp((((Clone.C1*Clone.C0:inverse())*Recoil)*CFrame.new())*ArmaClone.AimPart.CFrame:toObjectSpace(HeadBase.CFrame),.15)elseif AimPartMode==2 and ArmaClone:FindFirstChild("\065\105\109\080\097\114\116\050")~=nil then Clone.C1=Clone.C1:Lerp(((Clone.C1*Clone.C0:inverse())*Recoil)*ArmaClone.AimPart2.CFrame:toObjectSpace(HeadBase.CFrame),.15)else Clone.C1=Clone.C1:Lerp(((Clone.C1*Clone.C0:inverse())*Recoil)*ArmaClone.AimPart.CFrame:toObjectSpace(HeadBase.CFrame),.15)end else if not Bipod then Clone.C1=Clone.C1:Lerp((((Clone.C1*Clone.C0:inverse())*Recoil)*CFrame.new())*(ArmaClone.AimPart.CFrame*ArmaClone.AimPart.NVAim.CFrame):toObjectSpace(HeadBase.CFrame),.15)else Aiming=false stance=0 end end else if q and(stance==0 and Bipod==false)then Clone.C1=Clone.C1:Lerp((Clone.C0:inverse()*Recoil)*CFrame.new(0,0,((ArmaClone.Handle.Position-Y).magnitude/Settings.GunSize-1)*-Settings.GunFOVReduction),.15)else Clone.C1=Clone.C1:Lerp((Clone.C0:inverse()*Recoil)*CFrame.new(),.15)end end if ArmaClone:FindFirstChild("\066\105\112\111\100\080\111\105\110\116")~=nil then local J=Ray.new(ArmaClone.BipodPoint.Position,ArmaClone.BipodPoint.CFrame.UpVector*-1.75)local q,Y,d=workspace:FindPartOnRayWithIgnoreList(J,Ray_Ignore,false,true)if q and(stance==0 or stance==2)then Gui.Bipod.ImageColor3=Color3.fromRGB(255,255,0)BipodEnabled=true if BipodEnabled and Bipod then Gui.Bipod.ImageColor3=Color3.fromRGB(255,255,255)local J=0 HeadBase.CFrame=(Camera.CFrame*CFrame.new(0,0,-0.5))*CFrame.Angles(math.rad(J*math.sin(tick()*2.5)),math.rad(J*math.sin(tick()*1.25)),0)if stance==0 and not Aiming then Clone.C1=Clone.C1:Lerp((Clone.C0:inverse()*Recoil)*CFrame.new(0,((ArmaClone.BipodPoint.Position-Y).magnitude-1)*-1.5,0),.15)end else Gui.Bipod.ImageColor3=Color3.fromRGB(255,255,0)local J=Settings.SwayBase+(1-Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue)*Settings.MaxSway HeadBase.CFrame=(Camera.CFrame*CFrame.new(0,0,-0.5))*CFrame.Angles(math.rad(J*math.sin(tick()*2.5)),math.rad(J*math.sin(tick()*1.25)),0)end else Gui.Bipod.ImageColor3=Color3.fromRGB(255,0,0)Bipod=false BipodEnabled=false local J=Settings.SwayBase+(1-Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue)*Settings.MaxSway HeadBase.CFrame=(Camera.CFrame*CFrame.new(0,0,-0.5))*CFrame.Angles(math.rad(J*math.sin(tick()*2.5)),math.rad(J*math.sin(tick()*1.25)),0)end else Gui.Bipod.ImageColor3=Color3.fromRGB(255,0,0)local J=Settings.SwayBase+(1-Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue)*Settings.MaxSway HeadBase.CFrame=(Camera.CFrame*CFrame.new(0,0,-0.5))*CFrame.Angles(math.rad(J*math.sin(tick()*2.5)),math.rad(J*math.sin(tick()*1.25)),0)end if Equipped and LaserAtivo then if NVG then Pointer.Transparency=0 Laser.Enabled=true else if not ServerConfig.RealisticLaser then Laser.Enabled=true else Laser.Enabled=false end if IRmode then Pointer.Transparency=1 else Pointer.Transparency=0 end end local J=Ray.new(ArmaClone.LaserPoint.Position,AnimBase.CFrame.lookVector*999)local q,Y,d=workspace:FindPartOnRayWithIgnoreList(J,Ray_Ignore,false,true)LaserEP.CFrame=CFrame.new(0,0,-LaserDist)Pointer.CFrame=CFrame.new(Y,Y+d)if q then LaserDist=(ArmaClone.LaserPoint.Position-Y).magnitude else LaserDist=999 end Evt.SVLaser:FireServer(Y,1,ArmaClone.LaserPoint.Color,ArmaClient,IRmode)end end end)Evt.SVFlash.OnClientEvent:Connect(function(J,q,Y,d,Q,G,P)if J~=Jogador and J.Character["\083"..Y.Name].Grip:FindFirstChild("\070\108\097\115\104")~=nil then local g=J.Character["\083"..Y.Name]local t=Instance.new("\083\112\111\116\076\105\103\104\116")local X=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105")if q==true then t.Parent=g.Grip.Flash t.Angle=d t.Brightness=Q t.Range=P t.Color=G X.Parent=g.Grip.Flash X.Adornee=g.Grip.Flash X.Size=UDim2.new(10,0,10,0)local J=Instance.new("\073\109\097\103\101\076\097\098\101\108",X)J.BackgroundTransparency=1 J.Size=UDim2.new(1,20,1,20)J.AnchorPoint=Vector2.new(.5,.5)J.Position=UDim2.new(.5,0,.5,0)J.Image="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\056\052\055\050\053\056\048\050\051"J.ImageColor3=G J.ImageTransparency=.25 J.Rotation=math.random(-45,45)else if g.Grip.Flash:FindFirstChild("\083\112\111\116\076\105\103\104\116")~=nil then(g.Grip.Flash:FindFirstChild("\083\112\111\116\076\105\103\104\116")):Destroy()end if g.Grip.Flash:FindFirstChild("\066\105\108\108\098\111\097\114\100\071\117\105")~=nil then(g.Grip.Flash:FindFirstChild("\066\105\108\108\098\111\097\114\100\071\117\105")):Destroy()end end end end)Evt.SVLaser.OnClientEvent:Connect(function(J,q,Y,d,Q,G)if J~=Jogador then if BulletModel:FindFirstChild(J.Name.."\095\076\097\115\101\114")==nil then local q=Instance.new("\080\097\114\116")local Y=Instance.new("\065\116\116\097\099\104\109\101\110\116")Y.Name="\065\116\116\048"Y.Parent=q q.Name=J.Name.."\095\076\097\115\101\114"q.Parent=BulletModel q.Transparency=1 if J.Character and(J.Character:FindFirstChild("\083"..Q.Name)~=nil and((J.Character:WaitForChild("\083"..Q.Name)):WaitForChild("\071\114\105\112")):FindFirstChild("\076\097\115\101\114")~=nil)then local G=((J.Character:WaitForChild("\083"..Q.Name)):WaitForChild("\071\114\105\112")):WaitForChild("\076\097\115\101\114")local P=Instance.new("\066\101\097\109")P.Parent=q P.Transparency=NumberSequence.new(0)P.LightEmission=1 P.LightInfluence=0 P.Attachment0=Y P.Attachment1=G P.Color=ColorSequence.new(d)P.FaceCamera=true P.Width0=.01 P.Width1=.01 if not NVG then P.Enabled=false end end end if Y==1 then if BulletModel:FindFirstChild(J.Name.."\095\076\097\115\101\114")~=nil then local Y=BulletModel:FindFirstChild(J.Name.."\095\076\097\115\101\114")Y.Shape="\066\097\108\108"Y.Size=Vector3.new(.2,.2,.2)Y.CanCollide=false Y.Anchored=true Y.Color=d Y.Material=Enum.Material.Neon Y.Position=q if NVG then Y.Transparency=0 if Y:FindFirstChild("\066\101\097\109")~=nil then Y.Beam.Enabled=true end else if J.Character and(J.Character:FindFirstChild("\083"..Q.Name)~=nil and((J.Character:WaitForChild("\083"..Q.Name)):WaitForChild("\071\114\105\112")):FindFirstChild("\076\097\115\101\114")~=nil)then if G then Y.Transparency=1 else Y.Transparency=0 end end if Y:FindFirstChild("\066\101\097\109")~=nil then Y.Beam.Enabled=false end end end elseif Y==2 then if BulletModel:FindFirstChild(J.Name.."\095\076\097\115\101\114")~=nil then local q=BulletModel:FindFirstChild(J.Name.."\095\076\097\115\101\114")q:Destroy()end end end end)function Launcher()if Settings.FireModes.Explosive==true then(((Character:WaitForChild("\083"..ArmaClone.Name)):WaitForChild("\071\114\105\112")):WaitForChild("\070\105\114\101\050")):Play()local q=Instance.new("\080\097\114\116")q.Shape="\066\097\108\108"q.CanCollide=false q.Size=Vector3.new(.25,.25,.25)q.Material=Enum.Material.Metal q.Color=Color3.fromRGB(27,42,53)q.Parent=BulletModel q.CFrame=ArmaClone.SmokePart2.CFrame q.Velocity=ArmaClone.SmokePart2.CFrame.lookVector*403.8 local Y=Instance.new("\065\116\116\097\099\104\109\101\110\116")Y.Name="\065\116\049"Y.Position=Vector3.new(-0.15,0,0)Y.Parent=q local d=Instance.new("\065\116\116\097\099\104\109\101\110\116")d.Name="\065\116\050"d.Position=Vector3.new(.15,0,0)d.Parent=q local Q=Instance.new("\084\114\097\105\108")Q.Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,0,0),NumberSequenceKeypoint.new(1,1)})Q.WidthScale=NumberSequence.new({NumberSequenceKeypoint.new(0,2,0),NumberSequenceKeypoint.new(1,1)})Q.Texture="\114\098\120\097\115\115\101\116\105\100\058\047\047\050\051\050\057\049\056\054\050\050"Q.TextureMode=Enum.TextureMode.Stretch Q.FaceCamera=true Q.LightEmission=0 Q.LightInfluence=1 Q.Lifetime=.2 Q.Attachment0=Y Q.Attachment1=d Q.Parent=q local G,P,g,t local X,L,N,s local v=ArmaClone.SmokePart2.Position local f=q.Position local C=false local e while true do J.Heartbeat:wait()f=q.Position G,P,g,t=workspace:FindPartOnRayWithIgnoreList(Ray.new(v,(f-v)*20),Ray_Ignore,false,true)X,L,N,s=workspace:FindPartOnRayWithIgnoreList(Ray.new(v,f-v),Ray_Ignore,false,true)if G then while not e do if G and((G and G.Transparency>=1 or G.CanCollide==false or G.Name=="\073\103\110\111\114\097\098\108\101"or G.Name=="\071\108\097\115\115"or G.Parent.Name=="\084\111\112"or G.Parent.Name=="\072\101\108\109\101\116"or G.Parent.Name=="\085\112"or G.Parent.Name=="\068\111\119\110"or G.Parent.Name=="\070\097\099\101"or G.Parent.Name=="\079\108\104\111"or G.Parent.Name=="\072\101\097\100\115\101\116"or G.Parent.Name=="\078\117\109\101\114\111"or G.Parent.Name=="\086\101\115\116"or G.Parent.Name=="\067\104\101\115\116"or G.Parent.Name=="\087\097\105\115\116"or G.Parent.Name=="\066\097\099\107"or G.Parent.Name=="\066\101\108\116"or G.Parent.Name=="\076\101\103\049"or G.Parent.Name=="\076\101\103\050"or G.Parent.Name=="\065\114\109\049"or G.Parent.Name=="\065\114\109\050")and(G.Name~="\082\105\103\104\116 \065\114\109"and(G.Name~="\076\101\102\116 \065\114\109"and(G.Name~="\082\105\103\104\116 \076\101\103"and(G.Name~="\076\101\102\116 \076\101\103"and(G.Name~="\065\114\109\111\114"and G.Name~="\069\083\104\105\101\108\100"))))))then table.insert(Ray_Ignore,G)e=true end if e then G,P,g,t=workspace:FindPartOnRayWithIgnoreList(Ray.new(v,(f-v)*20),Ray_Ignore,false,true)X,L,N,s=workspace:FindPartOnRayWithIgnoreList(Ray.new(v,f-v),Ray_Ignore,false,true)e=false else break end end end if X and not e then Evt.LauncherHit:FireServer(L,X,N,s)Hitmarker.Explosion(L,X,N)q:remove()local J=Instance.new("\065\116\116\097\099\104\109\101\110\116")J.CFrame=CFrame.new(L,L+N)J.Parent=workspace.Terrain Debris:AddItem(J,5)local Y=Instance.new("\069\120\112\108\111\115\105\111\110")Y.BlastPressure=0 Y.BlastRadius=Settings.LauncherRadius Y.DestroyJointRadiusPercent=0 Y.Position=J.Position Y.Parent=J Y.Visible=false Y.Hit:connect(function(J,q)local d,Q=CheckForHumanoid(J)local G=math.random(Settings.LauncherDamage[1],Settings.LauncherDamage[2])if d==true and Q.Health>0 then local J=q/Y.BlastRadius J=1-J if J>0 then Evt.Damage:FireServer(Q,G*J,0,0)end end end)break end v=f end end end Evt.LauncherHit.OnClientEvent:Connect(function(J,q,Y,d)if J~=Jogador then Hitmarker.Explosion(q,Y,d)end end)Mouse.Button1Down:connect(function()if Equipped then MouseHeld=true if Settings.Mode~="\069\120\112\108\111\115\105\118\101"then if slideback or not Chambered.Value==true or Emperrado.Value==true then ArmaClone.Handle.Click:Play()return end elseif Settings.Mode=="\069\120\112\108\111\115\105\118\101"and GLChambered.Value==false or GLAmmo.Value<=0 then ArmaClone.Handle.Click:Play()return end if Can_Shoot and(not Reloading and(not Safe and not Correndo))then Can_Shoot=false if Settings.Mode=="\083\101\109\105"and(Ammo.Value>0 and Emperrado.Value==false)then Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)for J=1,Settings.Bullets,1 do coroutine.resume(coroutine.create(function()Balinha=CreateBullet(BSpread)CastRay(Balinha)end))end recoil()Emperrar()if Emperrado.Value==false then end Ammo.Value=Ammo.Value-1 if BSpread and not DecreasedAimLastShot then BSpread=math.min(Settings.MaxSpread,BSpread+Settings.AimInaccuracyStepAmount)RecoilPower=math.min(Settings.MaxRecoilPower,RecoilPower+Settings.RecoilPowerStepAmount)end DecreasedAimLastShot=not DecreasedAimLastShot if BSpread>=Settings.MaxSpread then OverHeat=true end wait(FireRate)elseif Settings.Mode=="\065\117\116\111"then while MouseHeld and(Equipped and(not Can_Shoot and(Emperrado.Value==false and Ammo.Value>0)))do Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)for J=1,Settings.Bullets,1 do coroutine.resume(coroutine.create(function()Balinha=CreateBullet(BSpread)CastRay(Balinha)end))end recoil()Emperrar()if Emperrado.Value==false then end Ammo.Value=Ammo.Value-1 if BSpread and not DecreasedAimLastShot then BSpread=math.min(Settings.MaxSpread,BSpread+Settings.AimInaccuracyStepAmount)RecoilPower=math.min(Settings.MaxRecoilPower,RecoilPower+Settings.RecoilPowerStepAmount)end DecreasedAimLastShot=not DecreasedAimLastShot if BSpread>=Settings.MaxSpread then OverHeat=true end wait(FireRate)end elseif Settings.Mode=="\066\117\114\115\116"and Ammo.Value>0 then for J=1,Settings.BurstShot,1 do for J=1,Settings.Bullets,1 do if MouseHeld and(Ammo.Value>0 and Emperrado.Value==false)then Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)coroutine.resume(coroutine.create(function()Balinha=CreateBullet(BSpread)CastRay(Balinha)end))recoil()Emperrar()if Emperrado.Value==false then end Ammo.Value=Ammo.Value-1 end end if BSpread and not DecreasedAimLastShot then BSpread=math.min(Settings.MaxSpread,BSpread+Settings.AimInaccuracyStepAmount)RecoilPower=math.min(Settings.MaxRecoilPower,RecoilPower+Settings.RecoilPowerStepAmount)end DecreasedAimLastShot=not DecreasedAimLastShot if BSpread>=Settings.MaxSpread then OverHeat=true end wait(BurstFireRate)end elseif Settings.Mode=="\066\111\108\116-\065\099\116\105\111\110"or Settings.Mode=="\080\117\109\112-\065\099\116\105\111\110"and(Ammo.Value>0 and Emperrado.Value==false)then Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)for J=1,Settings.Bullets,1 do coroutine.resume(coroutine.create(function()Balinha=CreateBullet(BSpread)CastRay(Balinha)end))end recoil()if Ammo.Value-1>0 then Emperrado.Value=true end if Emperrado==false then end Ammo.Value=Ammo.Value-1 if BSpread and not DecreasedAimLastShot then BSpread=math.min(Settings.MaxSpread,BSpread+Settings.AimInaccuracyStepAmount)RecoilPower=math.min(Settings.MaxRecoilPower,RecoilPower+Settings.RecoilPowerStepAmount)end DecreasedAimLastShot=not DecreasedAimLastShot if BSpread>=Settings.MaxSpread then OverHeat=true end if Settings.AutoChamber then if Aiming and Settings.ChamberWhileAim then MouseHeld=false Can_Shoot=false Reloading=true ChamberAnim()Sprint()Can_Shoot=true Reloading=false elseif not Aiming then MouseHeld=false Can_Shoot=false Reloading=true ChamberAnim()Sprint()Can_Shoot=true Reloading=false end end wait(FireRate)elseif Settings.Mode=="\069\120\112\108\111\115\105\118\101"and(GLAmmo.Value>0 and(GLChambered.Value==true and not Correndo))then GLChambered.Value=false GLAmmo.Value=GLAmmo.Value-1 coroutine.resume(coroutine.create(function()Launcher()end))end Can_Shoot=true Update_Gui()end end end)Mouse.Button1Up:connect(function()if Equipped then MouseHeld=false end end)Mouse.WheelForward:connect(function()if Equipped and(not Aiming and(not Reloading and not Correndo))then MouseHeld=false if stance==0 then Safe=true stance=1 Evt.Stance:FireServer(stance,Settings,Anims)StanceUp()elseif stance==-1 then Safe=false stance=0 Evt.Stance:FireServer(stance,Settings,Anims)IdleAnim()elseif stance==-2 then Safe=true stance=-1 Evt.Stance:FireServer(stance,Settings,Anims)StanceDown()end Update_Gui()end if Equipped and(Aiming and Sens.Value<100)then Sens.Value=Sens.Value+5 Update_Gui();(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).MouseDeltaSensitivity=Sens.Value/100 end end)Mouse.WheelBackward:connect(function()if Equipped and(not Aiming and(not Reloading and not Correndo))then MouseHeld=false if stance==0 then Safe=true stance=-1 Evt.Stance:FireServer(stance,Settings,Anims)StanceDown()elseif stance==-1 then Safe=true stance=-2 Evt.Stance:FireServer(stance,Settings,Anims)Patrol()elseif stance==1 then Safe=false stance=0 Evt.Stance:FireServer(stance,Settings,Anims)IdleAnim()end Update_Gui()end if Equipped and(Aiming and Sens.Value>5)then Sens.Value=Sens.Value-5 Update_Gui();(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).MouseDeltaSensitivity=Sens.Value/100 end end)Mouse.Button2Down:connect(function()if Equipped and(stance>-2 and(not Aiming and((Camera.Focus.p-Camera.CFrame.p).magnitude<1 and not Correndo)))then if NVG and(ArmaClone.AimPart:FindFirstChild("\078\086\065\105\109")~=nil and Bipod)then else if Safe then Safe=false IdleAnim()Update_Gui()end stance=2 Evt.Stance:FireServer(stance,Settings,Anims)Aiming=true;(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).MouseDeltaSensitivity=Sens.Value/100 ArmaClone.Handle.AimDown:Play()if not NVG or ArmaClone.AimPart:FindFirstChild("\078\086\065\105\109")==nil then if ArmaClone:FindFirstChild("\065\105\109\080\097\114\116\050")~=nil then if AimPartMode==1 then tweenFoV(Settings.ChangeFOV[1],120)if Settings.FocusOnSight then(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency=0})):Play()else(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end elseif AimPartMode==2 then tweenFoV(Settings.ChangeFOV[2],120)if Settings.FocusOnSight2 then(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency=0})):Play()else(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end end else if AimPartMode==1 then tweenFoV(Settings.ChangeFOV[1],120)if Settings.FocusOnSight then(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency=0})):Play()else(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end elseif AimPartMode==2 then tweenFoV(Settings.ChangeFOV[2],120)if Settings.FocusOnSight2 then(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency=0})):Play()else(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end end end else tweenFoV(70,120);(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end end elseif Aiming and Equipped then stance=0 Evt.Stance:FireServer(stance,Settings,Anims);(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).MouseDeltaSensitivity=1 ArmaClone.Handle.AimUp:Play()tweenFoV(70,120)Aiming=false;(TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end end)Human.Died:connect(function()ResetWorkspace()Human:UnequipTools()Evt.Rappel.CutEvent:FireServer()Unset()end)function onStateChanged(J,q)if q==Enum.HumanoidStateType.Swimming then Nadando=true if Equipped then Unset()Humanoid:UnequipTools()end else Nadando=false end if ServerConfig.EnableFallDamage then if q==Enum.HumanoidStateType.Freefall and not falling then falling=true local J=0 local q=0 while falling do J=HumanoidRootPart.Velocity.magnitude q=q+1 wait()end local Y=(J-ServerConfig.MaxVelocity)*ServerConfig.DamageMult if Y>5 and q>20 then local J=PastaFX.FallDamage:Clone()J.Parent=Player.PlayerGui J.Volume=Y/Human.MaxHealth J:Play()Debris:AddItem(J,J.TimeLength)Evt.Damage:FireServer(Human,Y,0,0)end elseif q==Enum.HumanoidStateType.Landed or q==Enum.HumanoidStateType.Dead then falling=false end end end Evt.ServerBullet.OnClientEvent:Connect(function(q,Y,d,Q,G,P,g,t,X,L,N)if q~=Jogador and q.Character then local t=Y local N=Instance.new("\080\097\114\116")N.Parent=workspace.ACS_WorkSpace.Server N.Name=q.Name.."\095\066\117\108\108\101\116"Debris:AddItem(N,5)N.Shape="\066\097\108\108"N.Size=Vector3.new(1,1,1)N.CanCollide=false N.CFrame=t N.Transparency=1 local s=N:GetMass()local v=Instance.new("\066\111\100\121\070\111\114\099\101",N)v.Force=Vector3.new(0,s*196.2-Q*196.2,0)N.Velocity=P*G local f=Instance.new("\065\116\116\097\099\104\109\101\110\116",N)f.Position=Vector3.new(.1,0,0)local C=Instance.new("\065\116\116\097\099\104\109\101\110\116",N)C.Position=Vector3.new(-0.1,0,0)if d then local J=Instance.new("\084\114\097\105\108",N)J.Attachment0=f J.Attachment1=C J.Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,0,0),NumberSequenceKeypoint.new(1,1)})J.WidthScale=NumberSequence.new({NumberSequenceKeypoint.new(0,2,0);NumberSequenceKeypoint.new(1,0)})J.Texture="\114\098\120\097\115\115\101\116\105\100\058\047\047\050\051\050\057\049\056\054\050\050"J.TextureMode=Enum.TextureMode.Stretch J.LightEmission=1 J.Lifetime=.2 J.FaceCamera=true J.Color=ColorSequence.new(g)end if X then local J=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105",N)J.Adornee=N local q=math.random(375,475)/10 J.Size=UDim2.new(q,0,q,0)J.LightInfluence=0 local Y=Instance.new("\073\109\097\103\101\076\097\098\101\108",J)Y.BackgroundTransparency=1 Y.Size=UDim2.new(1,0,1,0)Y.Position=UDim2.new(0,0,0,0)Y.Image="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\048\052\055\048\054\054\052\048\053"Y.ImageColor3=L Y.ImageTransparency=math.random(2,5)/15 if N:FindFirstChild("\066\105\108\108\098\111\097\114\100\071\117\105")~=nil then N.BillboardGui.Enabled=true end end local e={q.Character;N,workspace.ACS_WorkSpace}while true do J.Heartbeat:wait()local q=Ray.new(N.Position,N.CFrame.LookVector*25)local Y,d=workspace:FindPartOnRayWithIgnoreList(q,e,false,true)if Y then game.Debris:AddItem(N,0)break end end game.Debris:AddItem(N,0)return N end end)Human.StateChanged:connect(onStateChanged)Evt.ACS_AI.AIBullet.OnClientEvent:Connect(function(q,Y,d,Q,G,P,g,t,X,L,N)if q~=Jogador then local q=Y local t=Instance.new("\080\097\114\116")t.Parent=workspace.ACS_WorkSpace.Server t.Name="\065\073\095\066\117\108\108\101\116"Debris:AddItem(t,5)t.Shape="\066\097\108\108"t.Size=Vector3.new(1,1,1)t.CanCollide=false t.CFrame=q t.Transparency=1 local N=t:GetMass()local s=Instance.new("\066\111\100\121\070\111\114\099\101",t)s.Force=Vector3.new(0,N*196.2-Q*196.2,0)t.Velocity=P*G local v=Instance.new("\065\116\116\097\099\104\109\101\110\116",t)v.Position=Vector3.new(.1,0,0)local f=Instance.new("\065\116\116\097\099\104\109\101\110\116",t)f.Position=Vector3.new(-0.1,0,0)if d then local J=Instance.new("\084\114\097\105\108",t)J.Attachment0=v J.Attachment1=f J.Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,0,0);NumberSequenceKeypoint.new(1,1)})J.WidthScale=NumberSequence.new({NumberSequenceKeypoint.new(0,2,0);NumberSequenceKeypoint.new(1,0)})J.Texture="\114\098\120\097\115\115\101\116\105\100\058\047\047\050\051\050\057\049\056\054\050\050"J.TextureMode=Enum.TextureMode.Stretch J.LightEmission=1 J.Lifetime=.2 J.FaceCamera=true J.Color=ColorSequence.new(g)end if X then local J=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105",t)J.Adornee=t local q=math.random(375,475)/10 J.Size=UDim2.new(q,0,q,0)J.LightInfluence=0 local Y=Instance.new("\073\109\097\103\101\076\097\098\101\108",J)Y.BackgroundTransparency=1 Y.Size=UDim2.new(1,0,1,0)Y.Position=UDim2.new(0,0,0,0)Y.Image="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\048\052\055\048\054\054\052\048\053"Y.ImageColor3=L Y.ImageTransparency=math.random(2,5)/15 if t:FindFirstChild("\066\105\108\108\098\111\097\114\100\071\117\105")~=nil then t.BillboardGui.Enabled=true end end local C={t,workspace.ACS_WorkSpace}while true do J.Heartbeat:wait()local q=Ray.new(t.Position,t.CFrame.LookVector*25)local Y,d=workspace:FindPartOnRayWithIgnoreList(q,C,false,true)if Y then game.Debris:AddItem(t,0)break end end game.Debris:AddItem(t,0)return t end end)Evt.ACS_AI.AIShoot.OnClientEvent:Connect(function(J)for J,q in pairs(J.Muzzle:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=true end end delay(.033333333333333,function()for J,q in pairs(J.Muzzle:GetChildren())do if q.Name:sub(1,7)=="\070\108\097\115\104\070\088"or q.Name:sub(1,7)=="\083\109\111\107\101"then q.Enabled=false end end end)end)



function tweenFoV(goal, frames)
 coroutine.resume(coroutine.create(function()
  SFn = SFn and SFn + 1 or 0 
  local SFn_S = SFn
  for i = 1, frames do
   if SFn ~= SFn_S then break end
  		 Camera.FieldOfView = Camera.FieldOfView + (goal - Camera.FieldOfView) * (i / frames)
   game:GetService("RunService").RenderStepped:wait()
  end
 end))
end

function Lerp(n,g,t)
	return n+(g-n)*t
end

local RS = game:GetService("RunService")

function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
	spawn(function()
		local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
		local tweenIndicator = nil
		if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
			tweenIndicator = Instance.new("IntValue")
			tweenIndicator.Name = "tweenCode"
			tweenIndicator.Value = newCode
			tweenIndicator.Parent = Joint
		else
			tweenIndicator = Joint.tweenCode
			tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
		end
		--local tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
		if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
			if newC0 then Joint.C0 = newC0 end
			if newC1 then Joint.C1 = newC1 end
		else
			local Increment = 1.5 / Duration
			local startC0 = Joint.C0
			local startC1 = Joint.C1
			local X = 0
			while true do
				RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
				local newX = X + Increment
				X = (newX > 90 and 90 or newX)
				if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
				if (not Equipped) then break end --This stops the tween if the tool is deselected
				if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
				if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
				if X == 90 then break end
			end
		end
		if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
			tweenIndicator:Destroy()
		end
	end)
end


function LoadClientMods()
	for L_335_forvar1, L_336_forvar2 in pairs(GunMods:GetChildren()) do
		if L_336_forvar2:IsA('LocalScript') then
			local L_337_ = L_336_forvar2:clone()
			L_337_.Parent = ModStorageFolder
			L_337_.Disabled = false
		end
	end
end

function UnloadClientMods()
	for L_335_forvar1, L_336_forvar2 in pairs(ModStorageFolder:GetChildren()) do
		if L_336_forvar2:IsA('LocalScript') then
			L_336_forvar2:Destroy()
		end
	end
end

function CheckForHumanoid(L_225_arg1)
	local L_226_ = false
	local L_227_ = nil
	if L_225_arg1 then
		if (L_225_arg1.Parent:FindFirstChildOfClass("Humanoid") or L_225_arg1.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
			L_226_ = true
			if L_225_arg1.Parent:FindFirstChildOfClass('Humanoid') then
				L_227_ = L_225_arg1.Parent:FindFirstChildOfClass('Humanoid')
			elseif L_225_arg1.Parent.Parent:FindFirstChildOfClass('Humanoid') then
				L_227_ = L_225_arg1.Parent.Parent:FindFirstChildOfClass('Humanoid')
			end
		else
			L_226_ = false
		end	
	end
	return L_226_, L_227_
end

function CreateShell()
	delay(math.random(4,8)/10, function()
		if PastaFX:FindFirstChild('ShellCasing') then
			local Som = PastaFX.ShellCasing:clone()
			Som.Parent = Jogador.PlayerGui
			Som.PlaybackSpeed = math.random(30,50)/40
			Som.PlayOnRemove = true
			Debris:AddItem(Som, 0)
		end
	end)
end

local Tracers = 1
function TracerCalculation()
	local VisibleTracer
	if Settings.RandomTracer then
	if (math.random(1, 100) <= Settings.TracerChance) then	
		VisibleTracer = true
	else
		VisibleTracer = false
	end
	else
		if Tracers >= Settings.TracerEveryXShots then
			VisibleTracer = true
			Tracers = 1
		else
			Tracers = Tracers + 1
		end
	end
	return VisibleTracer
end

function CreateBullet(BSpread)

	local Bullet = Instance.new("Part")
	Bullet.Name = Player.Name.."_Bullet"
	Bullet.CanCollide = false
	Bullet.Transparency = 1
	Bullet.FormFactor = "Custom"
	Bullet.Size = Vector3.new(1,1,1)
	local BulletMass = Bullet:GetMass()
	local Force = Vector3.new(0,BulletMass * (196.2) - (Settings.BDrop) * (196.2), 0)
	local BF = Instance.new("BodyForce")
	BF.force = Force
	BF.Parent = Bullet
	local Origin = ArmaClone.SmokePart.Position
	local Direction = ArmaClone.SmokePart.CFrame.lookVector + (ArmaClone.SmokePart.CFrame.upVector * (((Settings.BDrop*Zeroing.Value/2.8)/Settings.BSpeed))/2)
	local BulletCF = CFrame.new(Origin, Origin + Direction)
	local balaspread = CFrame.Angles(
			RAD(RAND(-BSpread - ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier), BSpread + ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)) / 20),
			RAD(RAND(-BSpread - ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier), BSpread + ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)) / 20),
			RAD(RAND(-BSpread - ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier), BSpread + ((SpeedPrecision/Saude.Stances.Mobility.Value)*Settings.WalkMultiplier)) / 20)
		)
	Direction = balaspread * Direction	


	Bullet.Parent = BulletModel
	Bullet.CFrame = BulletCF + Direction
	Bullet.Velocity = Direction * Settings.BSpeed
	local RainbowModeCode = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))
		
	local Visivel = TracerCalculation()

if Settings.BulletFlare == true and Visivel then
	local bg = Instance.new("BillboardGui", Bullet)
		bg.Adornee = Bullet
		bg.Enabled = false
		local flashsize = math.random(275, 375)/10
		bg.Size = UDim2.new(flashsize, 0, flashsize, 0)
		bg.LightInfluence = 0
		local flash = Instance.new("ImageLabel", bg)
		flash.BackgroundTransparency = 1
		flash.Size = UDim2.new(1, 0, 1, 0)
		flash.Position = UDim2.new(0, 0, 0, 0)
		flash.Image = "http://www.roblox.com/asset/?id=1047066405"

		if Settings.RainbowMode == true then
			flash.ImageColor3 = RainbowModeCode
		else
			flash.ImageColor3 = Settings.BulletFlareColor
		end
		flash.ImageTransparency = math.random(2, 5)/15
		spawn(function()
				wait(.2)
				if Bullet:FindFirstChild("BillboardGui") ~= nil then
				Bullet.BillboardGui.Enabled = true
				end
		end)
end



if Settings.Tracer == true and Visivel then

	local At1 = Instance.new("Attachment")
	At1.Name = "At1"
	At1.Position = Vector3.new(-(Settings.TracerWidth),0,0)
	At1.Parent = Bullet
	
	local At2  = Instance.new("Attachment")
	At2.Name = "At2"
	At2.Position = Vector3.new((Settings.TracerWidth),0,0)
	At2.Parent = Bullet

	local Particles = Instance.new("Trail")
	Particles.Transparency = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 0, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)
	Particles.WidthScale = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 2, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)

	if Settings.RainbowMode == true then
		Particles.Color = ColorSequence.new(RainbowModeCode)
	else
		Particles.Color = ColorSequence.new(Settings.TracerColor)
	end
	Particles.Texture = "rbxassetid://232918622"
	Particles.TextureMode = Enum.TextureMode.Stretch
	
	Particles.FaceCamera = true
	Particles.LightEmission = Settings.TracerLightEmission
	Particles.LightInfluence = Settings.TracerLightInfluence 
	Particles.Lifetime = Settings.TracerLifeTime
	Particles.Attachment0 = At1
	Particles.Attachment1 = At2
	Particles.Parent = Bullet
end
	
if Settings.BulletLight == true and Visivel then
	local BulletLight = Instance.new("PointLight")
	BulletLight.Parent = Bullet
	BulletLight.Brightness = Settings.BulletLightBrightness
	if Settings.RainbowMode == true then
	BulletLight.Color = RainbowModeCode
	else
	BulletLight.Color = Settings.BulletLightColor
	end
	BulletLight.Range = Settings.BulletLightRange
	BulletLight.Shadows = true
	
end

	CreateShell()

	if Visivel then
		if ServerConfig.ReplicatedBullets then
			Evt.ServerBullet:FireServer(BulletCF, Settings.Tracer, Settings.BDrop, Settings.BSpeed, Direction, Settings.TracerColor,Ray_Ignore,Settings.BulletFlare,Settings.BulletFlareColor)
		end
	end
	game.Debris:AddItem(Bullet, 5)
	return Bullet

end


function CalcularDano(DanoBase,Dist,Vitima,Type)

	local damage = 0
	local VestDamage = 0
	local HelmetDamage = 0
	local Traveleddamage = DanoBase-(math.ceil(Dist)/40)*Settings.FallOfDamage
	if Vitima.Parent:FindFirstChild("Saude") ~= nil then

				local Vest =  Vitima.Parent.Saude.Protecao.VestVida
				local Vestfactor = Vitima.Parent.Saude.Protecao.VestProtect
				local Helmet = Vitima.Parent.Saude.Protecao.HelmetVida
				local Helmetfactor = Vitima.Parent.Saude.Protecao.HelmetProtect

		if Type == "Head" then
				if Helmet.Value > 0 and (Settings.BulletPenetration) < Helmetfactor.Value  then
					damage = Traveleddamage * ((Settings.BulletPenetration)/Helmetfactor.Value)
					HelmetDamage = (Traveleddamage * ((100 - Settings.BulletPenetration)/Helmetfactor.Value))
				
					if HelmetDamage <= 0 then
					HelmetDamage = 0.5
					end
					
				elseif Helmet.Value > 0 and (Settings.BulletPenetration) >= Helmetfactor.Value then
					damage = Traveleddamage
					HelmetDamage = (Traveleddamage * ((100 - Settings.BulletPenetration)/Helmetfactor.Value))
					
					if HelmetDamage <= 0 then
					HelmetDamage = 1
					end				

				elseif Helmet.Value <= 0 then
					damage = Traveleddamage
	
				end
			else
				if Vest.Value > 0 and (Settings.BulletPenetration) < Vestfactor.Value  then
					damage = Traveleddamage * ((Settings.BulletPenetration)/Vestfactor.Value)
					VestDamage = (Traveleddamage * ((100 - Settings.BulletPenetration)/Vestfactor.Value))
				
					if VestDamage <= 0 then
					VestDamage = 0.5
					end
					
				elseif Vest.Value > 0 and (Settings.BulletPenetration) >= Vestfactor.Value then
					damage = Traveleddamage
					VestDamage = (Traveleddamage * ((100 - Settings.BulletPenetration)/Vestfactor.Value))
					
					if VestDamage <= 0 then
					VestDamage =  1
					end				

				elseif Vest.Value <= 0 then
					damage = Traveleddamage
	
				end
			end
		else
			damage = Traveleddamage
	end			
		if damage <= 0 then
			damage = 1
		end

	return damage,VestDamage,HelmetDamage
end

local WhizzSound = {"342190005"; "342190012"; "342190017"; "342190024";}

Evt.Whizz.OnClientEvent:connect(function()

	local Som = Instance.new('Sound')
	Som.Parent = Jogador.PlayerGui
	Som.SoundId = "rbxassetid://"..WhizzSound[math.random(1,4)]
	Som.Volume = 2
	Som.PlayOnRemove = true
	Som:Destroy()

end)

Evt.Suppression.OnClientEvent:Connect(function(Mode,Intensity,Tempo)
	if ServerConfig.EnableStatusUI and Jogador.Character and Human.Health > 0 then
		if Mode == 1 then

			TS:Create(StatusClone.Efeitos.Suppress,TweenInfo.new(.1),{ImageTransparency = 0, Size = UDim2.fromScale(1,1.15)}):Play()
			delay(.1,function()
				TS:Create(StatusClone.Efeitos.Suppress,TweenInfo.new(1,Enum.EasingStyle.Exponential,Enum.EasingDirection.InOut,0,false,0.15),{ImageTransparency = 1,Size = UDim2.fromScale(2,2)}):Play()
			end)
		else
			--local SKP_22 = script.FX.Dirty:clone()
			--SKP_22.Parent = Jogador.PlayerGui.StatusUI.Supressao
			--SKP_22.ImageTransparency = 0
			--SKP_22.BackgroundTransparency = (Intensity - 1) * -1

			--TS:Create(SKP_22,TweenInfo.new(0.25 ,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0),{ImageTransparency = 0}):Play()
			--TS:Create(SKP_22,TweenInfo.new(Tempo/2 ,Enum.EasingStyle.Elastic,Enum.EasingDirection.In,0,false,0),{BackgroundTransparency = 1}):Play()


			--delay(Tempo/2,function()
			--TS:Create(SKP_22,TweenInfo.new(Tempo ,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0),{ImageTransparency = 1}):Play()
			--TS:AddItem(SKP_22, Tempo)
			--end)
		end
	end
end)


function CastRay(Bala)

	local Hit2, Pos2, Norm2, Mat2
	local Hit, Pos, Norm, Mat
	local L_257_ = ArmaClone.SmokePart.Position;
	local L_258_ = Bala.Position;
	local TotalDistTraveled = 0
	local L_260_ = false	
	local recast
	
	while true do
		RS.Heartbeat:wait()
		L_258_ = Bala.Position;
		TotalDistTraveled = TotalDistTraveled + (L_258_ - L_257_).magnitude
	
		Hit2, Pos2, Norm2, Mat2 = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)*20), Ray_Ignore, false, true);

		Hit, Pos, Norm, Mat = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)), Ray_Ignore, false, true);
		
		for L_264_forvar1, L_265_forvar2 in pairs(game.Players:GetChildren()) do
			if L_265_forvar2:IsA('Player') and L_265_forvar2 ~= Player and L_265_forvar2.Character and L_265_forvar2.Character:FindFirstChild('Head') and (L_265_forvar2.Character.Head.Position - Pos).magnitude <= Settings.SuppressMaxDistance and Settings.BulletWhiz and not L_260_ then
				Evt.Whizz:FireServer(L_265_forvar2)
				Evt.Suppression:FireServer(L_265_forvar2)
				L_260_ = true
			end
		end

		if TotalDistTraveled > Settings.Distance then
			Bala:Destroy()
			L_260_ = true
			break
		end
		
		if Hit2 then
			while not recast do
				if Hit2 and (Hit2 and Hit2.Transparency >= 1 or Hit2.CanCollide == false or Hit2.Name == "Ignorable" or Hit2.Name == "Glass" or Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1"  or Hit2.Parent.Name == "Arm2") and Hit2.Name ~= 'Right Arm' and Hit2.Name ~= 'Left Arm' and Hit2.Name ~= 'Right Leg' and Hit2.Name ~= 'Left Leg' and Hit2.Name ~= 'Armor' and Hit2.Name ~= 'EShield' then
					table.insert(Ray_Ignore, Hit2)
					recast = true
				end
	
				if recast then
					Hit2, Pos2, Norm2, Mat2 = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)*20), Ray_Ignore, false, true);
					Hit, Pos, Norm, Mat = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)), Ray_Ignore, false, true);
					recast = false
				else
					break
				end
			end
		end

		if Hit and not recast then
			Bala:Destroy()
			L_260_ = true
			local FoundHuman,VitimaHuman = CheckForHumanoid(Hit)
				Hitmarker.HitEffect(Ray_Ignore,ACS_Storage, Pos, Hit, Norm, Mat, Settings)
				Evt.Hit:FireServer(Pos, Hit, Norm, Mat,Settings,TotalDistTraveled)
			if FoundHuman == true and VitimaHuman.Health > 0 then
				if ServerConfig.HitmarkerSound then
					local hurtSound = PastaFX.Hitmarker:Clone()
					hurtSound.Parent = Player.PlayerGui
					hurtSound.Volume = 2
					hurtSound.PlayOnRemove = true
					Debris:AddItem(hurtSound,0)	
				end			

				if not  Settings.ModoTreino then
					Evt.CreateOwner:FireServer(VitimaHuman)

					if game.Players:FindFirstChild(VitimaHuman.Parent.Name) == nil then
							if Hit.Name == "Head" then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Torso" or Hit.Parent.Name == "UpperTorso" or Hit.Parent.Name == "LowerTorso" then
								local DanoBase = math.random(Settings.TorsoDamage[1], Settings.TorsoDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							else
								local DanoBase = math.random(Settings.LimbsDamage[1], Settings.LimbsDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							end	
				
					else
					
					if not ServerConfig.TeamKill then
						if game.Players:FindFirstChild(VitimaHuman.Parent.Name) and game.Players:FindFirstChild(VitimaHuman.Parent.Name).Team ~= Player.Team or game.Players:FindFirstChild(VitimaHuman.Parent.Name) == nil then
							if Hit.Name == "Head" or Hit.Parent.Name == "Top" or Hit.Parent.Name == "Headset" or Hit.Parent.Name == "Olho" or Hit.Parent.Name == "Face" or Hit.Parent.Name == "Numero" then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif (Hit.Parent:IsA('Accessory') or Hit.Parent:IsA('Hat')) then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Torso" or Hit.Parent.Name == "Chest" or Hit.Parent.Name == "Waist" then
								local DanoBase = math.random(Settings.TorsoDamage[1], Settings.TorsoDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Right Arm" or Hit.Name == "Right Leg" or Hit.Name == "Left Leg" or Hit.Name == "Left Arm" then
								local DanoBase = math.random(Settings.LimbsDamage[1], Settings.LimbsDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							end	
						end
					else
						if game.Players:FindFirstChild(VitimaHuman.Parent.Name) and game.Players:FindFirstChild(VitimaHuman.Parent.Name).Team ~= Player.Team or game.Players:FindFirstChild(VitimaHuman.Parent.Name) == nil  then				
							if Hit.Name == "Head" or Hit.Parent.Name == "Top" or Hit.Parent.Name == "Headset" or Hit.Parent.Name == "Olho" or Hit.Parent.Name == "Face" or Hit.Parent.Name == "Numero" then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif (Hit.Parent:IsA('Accessory') or Hit.Parent:IsA('Hat')) then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Torso" or Hit.Parent.Name == "Chest" or Hit.Parent.Name == "Waist" then
								local DanoBase = math.random(Settings.TorsoDamage[1], Settings.TorsoDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Right Arm" or Hit.Name == "Right Leg" or Hit.Name == "Left Leg" or Hit.Name == "Left Arm" then 
								local DanoBase = math.random(Settings.LimbsDamage[1], Settings.LimbsDamage[2])
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							end	
						else 
							if Hit.Name == "Head" or Hit.Parent.Name == "Top" or Hit.Parent.Name == "Headset" or Hit.Parent.Name == "Olho" or Hit.Parent.Name == "Face" or Hit.Parent.Name == "Numero" then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])* ServerConfig.TeamDamageMultiplier
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif (Hit.Parent:IsA('Accessory') or Hit.Parent:IsA('Hat')) then
								local DanoBase = math.random(Settings.HeadDamage[1], Settings.HeadDamage[2])* ServerConfig.TeamDamageMultiplier
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Torso" or Hit.Parent.Name == "Chest" or Hit.Parent.Name == "Waist" then
								local DanoBase = math.random(Settings.TorsoDamage[1], Settings.TorsoDamage[2])* ServerConfig.TeamDamageMultiplier
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							elseif Hit.Name == "Right Arm" or Hit.Name == "Right Leg" or Hit.Name == "Left Leg" or Hit.Name == "Left Arm" then
								local DanoBase = math.random(Settings.LimbsDamage[1], Settings.LimbsDamage[2])* ServerConfig.TeamDamageMultiplier
								local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")	
								Evt.Damage:FireServer(VitimaHuman,Dano,DanoColete,DanoCapacete)
							end	
						end
					end
				end
				else
				if Hit.Name == "Head" or Hit.Parent.Name == "Top" or Hit.Parent.Name == "Headset" or Hit.Parent.Name == "Olho" or Hit.Parent.Name == "Face" or Hit.Parent.Name == "Numero"  or (Hit.Parent:IsA('Accessory') or Hit.Parent:IsA('Hat')) or Hit.Name == "Torso" or Hit.Parent.Name == "Chest" or Hit.Parent.Name == "Waist" or Hit.Name == "Right Arm" or Hit.Name == "Left Arm" or Hit.Name == "Right Leg" or Hit.Name == "Left Leg" or Hit.Parent.Name == "Back" or Hit.Parent.Name == "Leg1" or Hit.Parent.Name == "Leg2" or Hit.Parent.Name == "Arm1" or Hit.Parent.Name == "Arm2" then
					Evt.Treino:FireServer(VitimaHuman)
				end
			end
			break
			end
		end		
		L_257_ = L_258_;
	end
end

Human.Running:connect(function(walkin)
	if Equipped then
		SpeedPrecision = walkin
		Sprint()
		if walkin > 1 then
			Walking = true
		else
			Walking = false
		end
	end
end)


Mouse.KeyDown:connect(function(Key)
	if Equipped then
		if Key == "w" then
			if not w then
				w = true
			end
		end
		if Key == "a" then
			if not a then
				a = true
			end
		end
		if Key == "s" then
			if not s then
				s = true
			end
		end
		if Key == "d" then
			if not d then
				d = true
			end
		end
	end
end)

Mouse.KeyUp:connect(function(Key)
	if Equipped then
		if Key == "w" then
			if w then
				w = false
			end
		end
		if Key == "a" then
			if a then
				a = false
			end
		end
		if Key == "s" then
			if s then
				s = false
			end
		end
		if Key == "d" then
			if d then
				d = false
			end
		end
	end
end)



function SlideEx()
						tweenJoint(ArmaClone.Handle:WaitForChild("Slide"),  CFrame.new(Settings.SlideExtend) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
						if Settings.MoveBolt == true then
						tweenJoint(ArmaClone.Handle:WaitForChild("Bolt"),  CFrame.new(Settings.BoltExtend) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
						end
						delay(FireRate/2,function()
							if Ammo.Value >= 1 then
								tweenJoint(ArmaClone.Handle:WaitForChild("Slide"),  CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
								if Settings.MoveBolt == true then
								tweenJoint(ArmaClone.Handle:WaitForChild("Bolt"),  CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
								end
							elseif Ammo.Value < 1 and Settings.SlideLock == true then
								Chambered.Value = false
								if Settings.MoveBolt == true and Settings.BoltLock == false then
								tweenJoint(ArmaClone.Handle:WaitForChild("Bolt"),  CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
								end
								ArmaClone.Handle.Click:Play()
								slideback = true
							elseif Ammo.Value < 1 and Settings.SlideLock == false then
								tweenJoint(ArmaClone.Handle:WaitForChild("Slide"),  CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
								if Settings.MoveBolt == true then
								tweenJoint(ArmaClone.Handle:WaitForChild("Bolt"),  CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0) , nil, function(X) return math.sin(math.rad(X)) end, 1 * (FireRate/2))
								end
								Chambered.Value = false
								ArmaClone.Handle.Click:Play()
							end
						end)
					end
function recoil()
		spawn(function()

					
					

					if Bipod then
						local vr  = (VRecoil)/5	
						local hr = ((HRecoil) * math.random(-1, 1))/5

						Camera.CFrame = Camera.CFrame * CFrame.Angles(vr, hr, 0)
						local c = -vr/30
						local cx = -(hr)/30
						local curId
						local EquipId = curId
						local vP
						if Settings.GunType == 0 then
							vP = (VPunchBase)
						else
							vP = (VPunchBase*10)/100
						end
					local hP = (math.random(-HPunchBase*25, HPunchBase*25))/100
					local dP = ((DPunchBase) * math.random(-1, 1))
						if not Aiming then
							Recoil = Recoil:lerp(Recoil*CFrame.new(0,0,(Settings.RecoilPunch/2)) * CFrame.Angles(RAD(vP*RecoilPower*0.25),RAD(hP*RecoilPower*0.25),RAD(dP*RecoilPower*0.25)),1)
						else
							Recoil = Recoil:lerp(Recoil*CFrame.new(0,0,(Settings.RecoilPunch/2)) * CFrame.Angles(RAD(vP*RecoilPower*0.25),RAD(hP*RecoilPower*0.25),RAD(dP*RecoilPower*0.25)),1)
						end
						for i = 1, 30 do
							if EquipId == curId then
								Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(c,  cx, 0) * CFrame.new(0, 0, (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude)
								wait()
							else
								break
							end
						end
					else
						local vr  = (VRecoil)	
						local hr = (HRecoil) * math.random(-1, 1)

						Camera.CFrame = Camera.CFrame * CFrame.Angles(vr, hr, 0)
						local c = -vr/30
						local cx = -(hr)/30
						local curId
						local EquipId = curId
						local vP
						if Settings.GunType == 0 then
							vP = (VPunchBase)
						else
							vP = (math.random(-VPunchBase*50,VPunchBase*100))/100
						end
					local hP = (math.random(-HPunchBase*100, HPunchBase*100))/100
					local dP = ((DPunchBase) * math.random(-1, 1))
						if not Aiming then
							Recoil = Recoil:lerp(Recoil*CFrame.new(0,0,(Settings.RecoilPunch)) * CFrame.Angles(RAD(vP*RecoilPower),RAD(hP*RecoilPower),RAD(dP*RecoilPower)),1)
						else
							Recoil = Recoil:lerp(Recoil*CFrame.new(0,0,(Settings.RecoilPunch/2)) * CFrame.Angles(RAD(vP*RecoilPower/Settings.AimRecoilReduction),RAD(hP*RecoilPower/Settings.AimRecoilReduction),RAD(dP*RecoilPower/Settings.AimRecoilReduction)),1)
						end
						for i = 1, 30*Settings.AimRecover do
								if EquipId == curId then
									Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(c,  cx, 0) * CFrame.new(0, 0, (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude)
									wait()
								else
									break
								end
							end
					end
				end)
				for _, v in pairs(ArmaClone.SmokePart:GetChildren()) do
				if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
					v.Enabled = true
					end
				end
				for _, a in pairs(ArmaClone.Chamber:GetChildren()) do
			if a.Name:sub(1, 7) == "FlashFX" or a.Name:sub(1, 7) == "Smoke" then
				a.Enabled = true
				end
			end

				delay(1 / 30, function()

					for _, v in pairs(ArmaClone.SmokePart:GetChildren()) do
						if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
							v.Enabled = false
						end
					end

					for _, a in pairs(ArmaClone.Chamber:GetChildren()) do
			if a.Name:sub(1, 7) == "FlashFX" or a.Name:sub(1, 7) == "Smoke" then
				a.Enabled = false
				end
			end

				end)
				if Silencer.Value == true then
					Character:WaitForChild('S'.. ArmaClone.Name):WaitForChild('Grip'):WaitForChild('Supressor'):Play()	
				else
					Character:WaitForChild('S'.. ArmaClone.Name):WaitForChild('Grip'):WaitForChild('Fire'):Play()	
					Character:WaitForChild('S'.. ArmaClone.Name):WaitForChild('Grip'):WaitForChild('Echo'):Play()
				end
				
				SlideEx()
		
end

function Emperrar()
	if Settings.CanBreak == true and Chambered.Value == true and (Ammo.Value - 1) > 0 then
	local Jam = math.random(Settings.JamChance)
	if Jam <= 2 then
		Emperrado.Value = true
		ArmaClone.Handle:WaitForChild("Click"):Play()
	end
end
end


function HalfStepFunc(Rot)
	if PlaceHolder then
		Offset = Human.CameraOffset
		Evt.HeadRot:FireServer(Rot, Offset, Equipped)
	end
	PlaceHolder = not PlaceHolder
end

oldtick = tick()
xTilt = 0
yTilt = 0
lastPitch = 0
lastYaw = 0
local TVal = 0

local L_199_ = nil
Personagem.ChildAdded:connect(function(Tool)
	if Tool:IsA('Tool') and Tool:FindFirstChild('ACS_Modulo') and Tool.ACS_Modulo:FindFirstChild('ACS_Setup') and Humanoid.Health > 0 and not ToolEquip and require(Tool.ACS_Modulo.ACS_Setup).Type == 'Gun' then
		local L_370_ = true
		if Personagem:WaitForChild('Humanoid').Sit and Personagem.Humanoid.SeatPart:IsA("VehicleSeat") or Personagem:WaitForChild('Humanoid').Sit and Personagem.Humanoid.SeatPart:IsA("VehicleSeat") or Nadando then
			L_370_ = false;
		end
		
		if L_370_ then
			L_199_ = Tool
			if not Equipped then
				uis.MouseIconEnabled = false
				Player.CameraMode = Enum.CameraMode.LockFirstPerson
				Setup(Tool)
				LoadClientMods()
				
	Ray_Ignore = {Character, Ignore_Model, Camera, BulletModel}
	
	Gui = StatusClone:WaitForChild("GunHUD")
	Gui.Visible = true
	CanUpdateGui = true
	Update_Gui()
	EquipAnim()
	if Settings.ZoomAnim and AimPartMode == 2 then
		ZoomAnim()
	end
	Sprint()
			elseif Equipped then
				Unset()
				Setup(L_199_)
				LoadClientMods()
			end;
		end;
	end
end)

Human.Seated:Connect(function(isSeated, seat)
	if isSeated and (seat:IsA("VehicleSeat")) then
		Unset()
		Humanoid:UnequipTools()
		Jogador.CameraMaxZoomDistance = ServerConfig.VehicleMaxZoom
	else
		Jogador.CameraMaxZoomDistance = game.StarterPlayer.CameraMaxZoomDistance
	end
end)

Jogador.Backpack.ChildRemoved:connect(function(L_371_arg1)
		Evt.Holster:FireServer(L_371_arg1)
end)

Personagem.ChildRemoved:connect(function(L_371_arg1)
	if L_371_arg1 == ArmaClient then
		if Equipped then
			if Balinha then
				Balinha:Destroy()
			end
			Unset()
		end
	end
end)

RS.RenderStepped:connect(function(Update)

	if not Equipped then
		HeadBase.CFrame = Camera.CFrame * CFrame.new(0, 0, -.5)
	else
		Update_Gui()
		HalfStepFunc(-math.asin(Camera.CoordinateFrame.lookVector.y))
		
		Recoil = Recoil:lerp(CFrame.new(),Settings.PunchRecover)		

		--RA.C0 = Recoil
		--LA.C0 = Recoil
			
		local Raio = Ray.new(ArmaClone.Handle.Position, Camera.CFrame.LookVector * Settings.GunSize)
		local Hit, Pos = workspace:FindPartOnRayWithIgnoreList(Raio, Ray_Ignore, false, true)

		local lk = Camera.CoordinateFrame.lookVector
		local x = lk.X
		local rise = lk.Y
		local z = lk.Z
		
		local lookpitch, lookyaw = math.asin(rise), -math.atan(x / z)
	
		local pitchChange = lastPitch - lookpitch
		local yawChange = lastYaw - lookyaw
		pitchChange = pitchChange * ((math.abs(pitchChange) < 1) and 1 or 0)
		yawChange = yawChange * ((math.abs(yawChange) < 1) and 1 or 0)
		yTilt = (yTilt * 0.5 + pitchChange)
		xTilt = (xTilt * 0.5 + yawChange)

		lastPitch = lookpitch
		lastYaw = lookyaw

			sway.t = V3(xTilt, yTilt, TVal)
			local swayVec = sway.p
			local TWAY = swayVec.z
			local XSWY = swayVec.X * 5
			local YSWY = swayVec.Y * 5							
								
			local xWalk = SIN(t*3)*(SpeedPrecision/ServerConfig.RunWalkSpeed *(WVal+1))
			local yWalk = COS(t*3)*(SpeedPrecision/ServerConfig.RunWalkSpeed *(WVal+1))
			local xWak  = SIN(t*1.75)*(SpeedPrecision/ServerConfig.RunWalkSpeed *(WVal+1))
			local yWak  = COS(t*3.5)*(SpeedPrecision/ServerConfig.RunWalkSpeed *(WVal+1))
			
			local zWalk = WVal	
			Walk.t = Vector3.new(xWalk,yWalk,WVal)
			local Walk2 = Walk.p
			local xWalk2 = Walk2.X/3
			local yWalk2 = Walk2.Y/3
			local zWalk2 = Walk2.Z/10
			local xWalk3 = Walk2.X/1
			local yWalk3 = Walk2.Y/1
			if Clone then
				if Aiming then
					zWalk = 0	
				else
					zWalk = WVal	
				end
				if Walking then
					WalkRate = (Human.WalkSpeed/3)	
					if a then
						TVal = Lerp(0,(-.20*SpeedPrecision/ServerConfig.RunWalkSpeed),10)
					elseif d then
						TVal = Lerp(0,(.20*SpeedPrecision/ServerConfig.RunWalkSpeed),10)
					else
						TVal = Lerp(0,0,10)
					end
				else
					WalkRate = (SpeedPrecision/ServerConfig.RunWalkSpeed) + .5
					WVal = Lerp(0,0,10)
				end									
				local currtick = tick()
				t = t + (((currtick - OldTick)*WalkRate))
				OldTick = currtick	
				local Sway = CFa(YSWY*RAD(5),-XSWY*RAD(5),-XSWY*RAD(0))
				Waval = Waval:lerp(CFn(xWalk3/220,-yWalk3/180,0)*CFn(xWak/220,-yWak/180,0)*CFa(0,0,zWalk2/5)*CFa(0,0,(TWAY/2)/10),1)
				Clone.C0 = Clone.C0:lerp(Waval*Sway,1)
			end
			if OverHeat and Can_Shoot then
			delay(5,function()
			if Can_Shoot then
			OverHeat = false
			end
			end)
		end

		if BSpread then
		local currTime = time()
		if currTime - LastSpreadUpdate > FireRate * 2 then
			LastSpreadUpdate = currTime
			BSpread = math.max(Settings.MinSpread, BSpread - (Settings.AimInaccuracyStepAmount)/5)
			RecoilPower =  math.max(Settings.MinRecoilPower, RecoilPower - (Settings.RecoilPowerStepAmount)/4)
		end
	end

	if OverHeat then
		ArmaClone.SmokePart.OverHeat.Enabled = true
	else
		ArmaClone.SmokePart.OverHeat.Enabled = false
	end
		
		if Aiming then
			if not NVG or ArmaClone.AimPart:FindFirstChild("NVAim") == nil then
				if AimPartMode == 1 and ArmaClone:FindFirstChild("AimPart2") ~= nil then
					Clone.C1 = Clone.C1:Lerp(Clone.C1 * Clone.C0:inverse() * Recoil * CFrame.new() * ArmaClone.AimPart.CFrame:toObjectSpace(HeadBase.CFrame),0.15)
				elseif AimPartMode == 2 and ArmaClone:FindFirstChild("AimPart2") ~= nil then
					Clone.C1 = Clone.C1:Lerp(Clone.C1 * Clone.C0:inverse() * Recoil * ArmaClone.AimPart2.CFrame:toObjectSpace(HeadBase.CFrame),0.15)
				else
					Clone.C1 = Clone.C1:Lerp(Clone.C1 * Clone.C0:inverse() * Recoil * ArmaClone.AimPart.CFrame:toObjectSpace(HeadBase.CFrame),0.15)
				end
			else
				if not Bipod then
					Clone.C1 = Clone.C1:Lerp(Clone.C1 * Clone.C0:inverse() * Recoil * CFrame.new() * (ArmaClone.AimPart.CFrame * ArmaClone.AimPart.NVAim.CFrame):toObjectSpace(HeadBase.CFrame),0.15)
				else
					Aiming = false
					stance = 0
				end
			end
		else
			if Hit and stance == 0 and Bipod == false then
				Clone.C1 = Clone.C1:Lerp(Clone.C0:inverse() * Recoil * CFrame.new(0,0,(((ArmaClone.Handle.Position - Pos).magnitude/Settings.GunSize) - 1) * -Settings.GunFOVReduction) ,0.15)
			else
				Clone.C1 = Clone.C1:Lerp(Clone.C0:inverse() * Recoil * CFrame.new(),0.15)
			end
		end

		if ArmaClone:FindFirstChild("BipodPoint") ~= nil then

			local BipodRay = Ray.new(ArmaClone.BipodPoint.Position, ArmaClone.BipodPoint.CFrame.UpVector * -1.75)
			local BipodHit, BipodPos, BipodNorm = workspace:FindPartOnRayWithIgnoreList(BipodRay, Ray_Ignore, false, true)

			if BipodHit and (stance == 0 or stance == 2) then
				Gui.Bipod.ImageColor3 = Color3.fromRGB(255, 255, 0)
				BipodEnabled = true
				if BipodEnabled and Bipod then
					Gui.Bipod.ImageColor3 = Color3.fromRGB(255, 255, 255)
					local StaminaValue = 0
					HeadBase.CFrame = Camera.CFrame * CFrame.new(0, 0, -.5) * CFrame.Angles( math.rad(StaminaValue * math.sin( tick() * 2.5 )),math.rad(StaminaValue * math.sin( tick() * 1.25 )), 0)
					if stance == 0 and not Aiming then
						Clone.C1 = Clone.C1:Lerp(Clone.C0:inverse() * Recoil * CFrame.new(0,(((ArmaClone.BipodPoint.Position - BipodPos).magnitude)-1) * (-1.5), 0) ,0.15)
					end
				else
					Gui.Bipod.ImageColor3 = Color3.fromRGB(255, 255, 0)
					local StaminaValue = Settings.SwayBase + (1-(Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue))* Settings.MaxSway
					HeadBase.CFrame = Camera.CFrame * CFrame.new(0, 0, -.5) * CFrame.Angles( math.rad(StaminaValue * math.sin( tick() * 2.5 )),math.rad(StaminaValue * math.sin( tick() * 1.25 )), 0)
				end
			else
				Gui.Bipod.ImageColor3 = Color3.fromRGB(255, 0, 0)
				Bipod = false
				BipodEnabled = false
				local StaminaValue = Settings.SwayBase + (1-(Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue))* Settings.MaxSway
				HeadBase.CFrame = Camera.CFrame * CFrame.new(0, 0, -.5) * CFrame.Angles( math.rad(StaminaValue * math.sin( tick() * 2.5 )),math.rad(StaminaValue * math.sin( tick() * 1.25 )), 0)
			end		

		else
			Gui.Bipod.ImageColor3 = Color3.fromRGB(255, 0, 0)
			local StaminaValue = Settings.SwayBase + (1-(Personagem.Saude.Variaveis.Stamina.Value/Personagem.Saude.Variaveis.Stamina.MaxValue))* Settings.MaxSway
			HeadBase.CFrame = Camera.CFrame * CFrame.new(0, 0, -.5) * CFrame.Angles( math.rad(StaminaValue * math.sin( tick() * 2.5 )),math.rad(StaminaValue * math.sin( tick() * 1.25 )), 0)
		end

		

		if Equipped and LaserAtivo then
			if NVG then
				Pointer.Transparency = 0
				Laser.Enabled = true
				
			else
			
				if not ServerConfig.RealisticLaser then
					Laser.Enabled = true
				else
					Laser.Enabled = false
				end
			
				if IRmode then
					Pointer.Transparency = 1
				else
					Pointer.Transparency = 0
				end
			end

			local L_361_ = Ray.new(ArmaClone.LaserPoint.Position, AnimBase.CFrame.lookVector * 999)
			local Hit, Pos, Normal = workspace:FindPartOnRayWithIgnoreList(L_361_, Ray_Ignore, false, true)
			
			LaserEP.CFrame = CFrame.new(0, 0, -LaserDist)
			Pointer.CFrame =  CFrame.new(Pos, Pos + Normal)
		
			
			if Hit then
				LaserDist = (ArmaClone.LaserPoint.Position - Pos).magnitude
			else
				LaserDist = 999
			end
			Evt.SVLaser:FireServer(Pos,1,ArmaClone.LaserPoint.Color,ArmaClient,IRmode)
		end
end
	end)

Evt.SVFlash.OnClientEvent:Connect(function(Player,Mode,Arma,Angle,Bright,Color,Range)
	if Player ~= Jogador and Player.Character['S' .. Arma.Name].Grip:FindFirstChild("Flash") ~= nil then
		local Arma = Player.Character['S' .. Arma.Name]
		local Luz = Instance.new("SpotLight")
		local bg = Instance.new("BillboardGui")
		
		
		if Mode == true then
		Luz.Parent = Arma.Grip.Flash
		Luz.Angle = Angle
		Luz.Brightness = Bright
		Luz.Range = Range
		Luz.Color = Color
		
		bg.Parent = Arma.Grip.Flash
		bg.Adornee = Arma.Grip.Flash
		bg.Size = UDim2.new(10, 0, 10, 0)

		local flash = Instance.new("ImageLabel", bg)
		flash.BackgroundTransparency = 1
		flash.Size = UDim2.new(1, 20, 1, 20)
		flash.AnchorPoint = Vector2.new(0.5,0.5)
		flash.Position = UDim2.new(0.5, 0, 0.5, 0)
		flash.Image = "http://www.roblox.com/asset/?id=1847258023"
		flash.ImageColor3 = Color
		flash.ImageTransparency = 0.25
		flash.Rotation = math.random(-45, 45)

		else
			if Arma.Grip.Flash:FindFirstChild("SpotLight") ~= nil then
				Arma.Grip.Flash:FindFirstChild("SpotLight"):Destroy()
			end
			if Arma.Grip.Flash:FindFirstChild("BillboardGui") ~= nil then
				Arma.Grip.Flash:FindFirstChild("BillboardGui"):Destroy()
			end
		end
	end
end)

Evt.SVLaser.OnClientEvent:Connect(function(Player,Position,Modo,Cor,Arma,IR)

if Player ~= Jogador then

	if BulletModel:FindFirstChild(Player.Name.."_Laser") == nil then
		local Dot = Instance.new('Part')
		local Att0 = Instance.new('Attachment')
		Att0.Name = "Att0"
		Att0.Parent = Dot
		Dot.Name = Player.Name.."_Laser"
		Dot.Parent = BulletModel
		Dot.Transparency = 1

		if Player.Character and Player.Character:FindFirstChild('S'.. Arma.Name) ~= nil and Player.Character:WaitForChild('S'.. Arma.Name):WaitForChild('Grip'):FindFirstChild("Laser") ~= nil then
		local Muzzle = Player.Character:WaitForChild('S'.. Arma.Name):WaitForChild('Grip'):WaitForChild("Laser")


		local Laser = Instance.new('Beam')
			Laser.Parent = Dot
			Laser.Transparency = NumberSequence.new(0)
			Laser.LightEmission = 1
			Laser.LightInfluence = 0
			Laser.Attachment0 = Att0
			Laser.Attachment1 = Muzzle
			Laser.Color = ColorSequence.new(Cor)
			Laser.FaceCamera = true
			Laser.Width0 = 0.01
			Laser.Width1 = 0.01
		if not NVG then
			Laser.Enabled = false
		end
	end
	end
	
if Modo == 1 then
	if BulletModel:FindFirstChild(Player.Name.."_Laser") ~= nil then
		local LA = BulletModel:FindFirstChild(Player.Name.."_Laser")
		LA.Shape = 'Ball'
		LA.Size = Vector3.new(0.2, 0.2, 0.2)
		LA.CanCollide = false
		LA.Anchored = true
		LA.Color = Cor
		LA.Material = Enum.Material.Neon
		LA.Position = Position	

		if NVG then

			LA.Transparency = 0

			if LA:FindFirstChild("Beam") ~= nil then
				LA.Beam.Enabled = true
			end
		
		else

			if Player.Character and Player.Character:FindFirstChild('S'.. Arma.Name) ~= nil and Player.Character:WaitForChild('S'.. Arma.Name):WaitForChild('Grip'):FindFirstChild("Laser") ~= nil then
				if IR then
					LA.Transparency = 1
				else
					LA.Transparency = 0
				end
			end

			if LA:FindFirstChild("Beam") ~= nil then
				LA.Beam.Enabled = false
			end			

		end
		
	end

elseif Modo == 2 then
	if BulletModel:FindFirstChild(Player.Name.."_Laser") ~= nil then
		local LA = BulletModel:FindFirstChild(Player.Name.."_Laser")
		LA:Destroy()
	end
end
end
end)

function Launcher()
	if Settings.FireModes.Explosive == true then
		Character:WaitForChild('S'.. ArmaClone.Name):WaitForChild('Grip'):WaitForChild('Fire2'):Play()
		

		
	local M203 = Instance.new("Part")
	M203.Shape = 'Ball'
	M203.CanCollide = false
	M203.Size = Vector3.new(0.25,0.25,0.25)
	M203.Material = Enum.Material.Metal
	M203.Color = Color3.fromRGB(27, 42, 53)
	M203.Parent = BulletModel
	M203.CFrame = ArmaClone.SmokePart2.CFrame
	M203.Velocity = ArmaClone.SmokePart2.CFrame.lookVector*(600-196.2)


	local At1 = Instance.new("Attachment")
	At1.Name = "At1"
	At1.Position = Vector3.new(-.15,0,0)
	At1.Parent = M203
	
	local At2  = Instance.new("Attachment")
	At2.Name = "At2"
	At2.Position = Vector3.new(.15,0,0)
	At2.Parent = M203

	local Particles = Instance.new("Trail")
	Particles.Transparency = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 0, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)
	Particles.WidthScale = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 2, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)

	
	Particles.Texture = "rbxassetid://232918622"
	Particles.TextureMode = Enum.TextureMode.Stretch
	
	Particles.FaceCamera = true
	Particles.LightEmission = 0
	Particles.LightInfluence = 1
	Particles.Lifetime = 0.2
	Particles.Attachment0 = At1
	Particles.Attachment1 = At2
	Particles.Parent = M203


	local Hit2, Pos2, Norm2, Mat2
	local Hit, Pos, Norm, Mat
	local L_257_ = ArmaClone.SmokePart2.Position;
	local L_258_ = M203.Position;
	local L_260_ = false	
	local recast
	
	while true do
		RS.Heartbeat:wait()
		L_258_ = M203.Position;
	
		Hit2, Pos2, Norm2, Mat2 = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)*20), Ray_Ignore, false, true);

		Hit, Pos, Norm, Mat = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)), Ray_Ignore, false, true);
		
		if Hit2 then
			while not recast do
				if Hit2 and (Hit2 and Hit2.Transparency >= 1 or Hit2.CanCollide == false or Hit2.Name == "Ignorable" or Hit2.Name == "Glass" or Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1"  or Hit2.Parent.Name == "Arm2") and Hit2.Name ~= 'Right Arm' and Hit2.Name ~= 'Left Arm' and Hit2.Name ~= 'Right Leg' and Hit2.Name ~= 'Left Leg' and Hit2.Name ~= 'Armor' and Hit2.Name ~= 'EShield' then
					table.insert(Ray_Ignore, Hit2)
					recast = true
				end
	
				if recast then
					Hit2, Pos2, Norm2, Mat2 = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)*20), Ray_Ignore, false, true);
					Hit, Pos, Norm, Mat = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_257_, (L_258_ - L_257_)), Ray_Ignore, false, true);
					recast = false
				else
					break
				end
			end
		end

			if Hit and not recast then
				Evt.LauncherHit:FireServer(Pos, Hit, Norm, Mat)
				Hitmarker.Explosion(Pos, Hit, Norm)
				M203:remove()

		local Hitmark = Instance.new("Attachment")
		Hitmark.CFrame = CFrame.new(Pos, Pos + Norm)
		Hitmark.Parent = workspace.Terrain
		Debris:AddItem(Hitmark, 5)

		local Exp = Instance.new("Explosion")
		Exp.BlastPressure = 0
		Exp.BlastRadius = Settings.LauncherRadius
		Exp.DestroyJointRadiusPercent = 0
		Exp.Position = Hitmark.Position
		Exp.Parent = Hitmark
		Exp.Visible = false
	
		Exp.Hit:connect(function(hitPart, partDistance)

  		local FoundHuman,VitimaHuman = CheckForHumanoid(hitPart)
			local damage = math.random(Settings.LauncherDamage[1],Settings.LauncherDamage[2])
    			if FoundHuman == true and VitimaHuman.Health > 0 then
    		  	  local distance_factor = partDistance / Exp.BlastRadius    -- get the distance as a value between 0 and 1
      		 		 distance_factor = 1 - distance_factor                         -- flip the amount, so that lower == closer == more damage
					if distance_factor > 0 then
						Evt.Damage:FireServer(VitimaHuman,(damage*distance_factor),0,0)
  					 end
				end
		end)
			
				break
			end
			L_257_ = L_258_;
		end
	end		
end

Evt.LauncherHit.OnClientEvent:Connect(function(Player, Position, HitPart, Normal)
	if Player ~= Jogador then 
		Hitmarker.Explosion(Position, HitPart, Normal)
	end
end)

Mouse.Button1Down:connect(function()
	if Equipped then
	MouseHeld = true

	
if Settings.Mode ~= "Explosive" then
	if slideback or not Chambered.Value == true or Emperrado.Value == true then
		ArmaClone.Handle.Click:Play()
		return
	end
elseif Settings.Mode == "Explosive" and GLChambered.Value == false or GLAmmo.Value <= 0 then
	ArmaClone.Handle.Click:Play()
	return	
end


	if Can_Shoot and not Reloading and not Safe and not Correndo then
	Can_Shoot = false
	if Settings.Mode == "Semi" and Ammo.Value > 0 and Emperrado.Value == false then
		Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)
		for _ = 1, Settings.Bullets do
			coroutine.resume(coroutine.create(function()
			Balinha = CreateBullet(BSpread)
			CastRay(Balinha)
				end))
			end	
		recoil()
		Emperrar()
		if Emperrado.Value == false then
			--EjectShells()
		end
		Ammo.Value = Ammo.Value - 1

		if BSpread and not DecreasedAimLastShot then
				BSpread = math.min(Settings.MaxSpread, BSpread + Settings.AimInaccuracyStepAmount)
				RecoilPower =  math.min(Settings.MaxRecoilPower, RecoilPower + Settings.RecoilPowerStepAmount)
			end
			DecreasedAimLastShot = not DecreasedAimLastShot
			if BSpread >= Settings.MaxSpread then
				OverHeat = true
			end

		wait(FireRate)
	elseif Settings.Mode == "Auto" then
		while MouseHeld and Equipped and not Can_Shoot and Emperrado.Value == false and Ammo.Value > 0 do
			Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)
			for _ = 1, Settings.Bullets do
			coroutine.resume(coroutine.create(function()
			Balinha = CreateBullet(BSpread)
			CastRay(Balinha)
			end))
			end		
			recoil()
			Emperrar()
			if Emperrado.Value == false then
			--EjectShells()
			end
			Ammo.Value = Ammo.Value - 1

			if BSpread and not DecreasedAimLastShot then
				BSpread = math.min(Settings.MaxSpread, BSpread + Settings.AimInaccuracyStepAmount)
				RecoilPower =  math.min(Settings.MaxRecoilPower, RecoilPower + Settings.RecoilPowerStepAmount)
			end
			DecreasedAimLastShot = not DecreasedAimLastShot
			if BSpread >= Settings.MaxSpread then
				OverHeat = true
			end

			wait(FireRate)
		end
	elseif Settings.Mode == "Burst" and Ammo.Value > 0 then
		for i = 1, Settings.BurstShot do
			for _ = 1, Settings.Bullets do
				if MouseHeld and Ammo.Value > 0 and Emperrado.Value == false then
					Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)
					coroutine.resume(coroutine.create(function()
					Balinha = CreateBullet(BSpread)
					CastRay(Balinha)
					end))
					recoil()
					Emperrar()
					if Emperrado.Value == false then
					--EjectShells()
					end
					Ammo.Value = Ammo.Value - 1
				end
			end	

			if BSpread and not DecreasedAimLastShot then
				BSpread = math.min(Settings.MaxSpread, BSpread + Settings.AimInaccuracyStepAmount)
				RecoilPower =  math.min(Settings.MaxRecoilPower, RecoilPower + Settings.RecoilPowerStepAmount)
			end
			DecreasedAimLastShot = not DecreasedAimLastShot
			if BSpread >= Settings.MaxSpread then
				OverHeat = true
			end

			wait(BurstFireRate)
		end
		elseif Settings.Mode == "Bolt-Action" or Settings.Mode == "Pump-Action" and Ammo.Value > 0 and Emperrado.Value == false then
		Evt.Atirar:FireServer(FireRate,Anims,ArmaClient)
		for _ = 1, Settings.Bullets do


		coroutine.resume(coroutine.create(function()
		Balinha = CreateBullet(BSpread)
		CastRay(Balinha)
		end))
			end	
		recoil()
		if (Ammo.Value - 1) > 0 then
		Emperrado.Value = true
		end
		if Emperrado == false then
			--EjectShells()
		end
		Ammo.Value = Ammo.Value - 1
		if BSpread and not DecreasedAimLastShot then
				BSpread = math.min(Settings.MaxSpread, BSpread + Settings.AimInaccuracyStepAmount)
				RecoilPower =  math.min(Settings.MaxRecoilPower, RecoilPower + Settings.RecoilPowerStepAmount)
			end
			DecreasedAimLastShot = not DecreasedAimLastShot
			if BSpread >= Settings.MaxSpread then
				OverHeat = true
			end
		if (Settings.AutoChamber) then
		if Aiming and (Settings.ChamberWhileAim) then
			MouseHeld = false
			Can_Shoot = false
			Reloading = true
			ChamberAnim()
			Sprint()
			Can_Shoot = true
			Reloading = false
		elseif not Aiming then
			MouseHeld = false
			Can_Shoot = false
			Reloading = true
			ChamberAnim()
			Sprint()
			Can_Shoot = true
			Reloading = false
		end
		end
		wait(FireRate)



	elseif Settings.Mode == "Explosive" and GLAmmo.Value > 0 and GLChambered.Value == true and not Correndo then
		GLChambered.Value = false
		GLAmmo.Value = GLAmmo.Value - 1	
		coroutine.resume(coroutine.create(function()
		Launcher()
		end))
	end
	Can_Shoot = true
	Update_Gui()
	end
	end
end)

Mouse.Button1Up:connect(function()
	if Equipped then
		MouseHeld = false
	end
end)

Mouse.WheelForward:connect(function()
if Equipped and not Aiming and not Reloading and not Correndo then
	MouseHeld = false
	if stance == 0 then
		Safe = true
		stance = 1
		Evt.Stance:FireServer(stance,Settings,Anims)
		StanceUp()
	elseif stance == -1 then
		Safe = false
		stance = 0
		Evt.Stance:FireServer(stance,Settings,Anims)
		IdleAnim()
	elseif stance == -2 then
		Safe = true
		stance = -1
		Evt.Stance:FireServer(stance,Settings,Anims)
		StanceDown()
	end
	Update_Gui()
end

if Equipped and Aiming and Sens.Value < 100 then
	Sens.Value = Sens.Value + 5
	Update_Gui()
	game:GetService('UserInputService').MouseDeltaSensitivity = (Sens.Value/100)
end

end)

Mouse.WheelBackward:connect(function()
if Equipped and not Aiming and not Reloading and not Correndo then
	MouseHeld = false
	if stance == 0 then
		Safe = true
		stance = -1
		Evt.Stance:FireServer(stance,Settings,Anims)
		StanceDown()
	elseif stance == -1 then
		Safe = true
		stance = -2
		Evt.Stance:FireServer(stance,Settings,Anims)
		Patrol()
	elseif stance == 1 then
		Safe = false
		stance = 0
		Evt.Stance:FireServer(stance,Settings,Anims)
		IdleAnim()
	end
	Update_Gui()
end

if Equipped and Aiming and Sens.Value > 5 then
	Sens.Value = Sens.Value - 5
	Update_Gui()
	game:GetService('UserInputService').MouseDeltaSensitivity = (Sens.Value/100)
end

end)

Mouse.Button2Down:connect(function()
	if Equipped and stance > -2 and not Aiming and (Camera.Focus.p - Camera.CFrame.p).magnitude < 1 and not Correndo then
		if NVG and ArmaClone.AimPart:FindFirstChild("NVAim") ~= nil and Bipod then
		else
			if Safe then
				Safe = false
				IdleAnim()
				Update_Gui()
			end
			stance = 2
			Evt.Stance:FireServer(stance,Settings,Anims)
			Aiming = true
			game:GetService('UserInputService').MouseDeltaSensitivity = (Sens.Value/100)
			ArmaClone.Handle.AimDown:Play()

if not NVG or ArmaClone.AimPart:FindFirstChild("NVAim") == nil then
	if ArmaClone:FindFirstChild('AimPart2') ~= nil then
		if AimPartMode == 1 then
			tweenFoV(Settings.ChangeFOV[1],120)
			if Settings.FocusOnSight then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
		elseif AimPartMode == 2 then
			tweenFoV(Settings.ChangeFOV[2],120)
			if Settings.FocusOnSight2 then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
		end
	else
		if AimPartMode == 1 then
			tweenFoV(Settings.ChangeFOV[1],120)
			if Settings.FocusOnSight then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
		elseif AimPartMode == 2 then
			tweenFoV(Settings.ChangeFOV[2],120)
			if Settings.FocusOnSight2 then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
			end
		end
	else
		tweenFoV(70,120)
		TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
	end
end
		elseif Aiming and Equipped  then
			stance = 0
			Evt.Stance:FireServer(stance,Settings,Anims)
			game:GetService('UserInputService').MouseDeltaSensitivity = 1
			ArmaClone.Handle.AimUp:Play()	
			tweenFoV(70,120)
			Aiming = false
			TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
	end
end)
	
Human.Died:connect(function()
	ResetWorkspace()
	Human:UnequipTools()
	Evt.Rappel.CutEvent:FireServer()
	Unset()
end)


function onStateChanged(_,state)
	if state == Enum.HumanoidStateType.Swimming then
		Nadando = true
	if Equipped then
		Unset()
		Humanoid:UnequipTools()
	end
	else
		Nadando = false
	end

	if ServerConfig.EnableFallDamage then
		if state == Enum.HumanoidStateType.Freefall and not falling then
			falling = true
			local curVel = 0
			local peak = 0
			
			while falling do
				curVel = HumanoidRootPart.Velocity.magnitude
				peak = peak + 1
				wait()
			end
			local damage = (curVel - (ServerConfig.MaxVelocity)) * ServerConfig.DamageMult
			if damage > 5 and peak > 20 then
					local hurtSound = PastaFX.FallDamage:Clone()
					hurtSound.Parent = Player.PlayerGui
					hurtSound.Volume = damage/Human.MaxHealth
					hurtSound:Play()
					Debris:AddItem(hurtSound,hurtSound.TimeLength)
				Evt.Damage:FireServer(Human,damage,0,0)
			end
		elseif state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Dead then
			falling = false
		end
	end
end

Evt.ServerBullet.OnClientEvent:Connect(function(SKP_arg1,SKP_arg3,SKP_arg4,SKP_arg5,SKP_arg6,SKP_arg7,SKP_arg8,SKP_arg9,SKP_arg10,SKP_arg11,SKP_arg12)
if SKP_arg1 ~= Jogador and SKP_arg1.Character then 
local SKP_01 = SKP_arg3
	local SKP_02 = Instance.new("Part")
	SKP_02.Parent = workspace.ACS_WorkSpace.Server
	SKP_02.Name = SKP_arg1.Name..'_Bullet'
	Debris:AddItem(SKP_02, 5)
	SKP_02.Shape = "Ball"
	SKP_02.Size = Vector3.new(1, 1, 1)
	SKP_02.CanCollide = false
	SKP_02.CFrame = SKP_01
	SKP_02.Transparency = 1

	local SKP_03 = SKP_02:GetMass()
	local SKP_04 = Instance.new('BodyForce', SKP_02)
	
	SKP_04.Force = Vector3.new(0,SKP_03 * (196.2) - SKP_arg5 * (196.2), 0)
	SKP_02.Velocity = SKP_arg7 * SKP_arg6

	local SKP_05 = Instance.new('Attachment', SKP_02)
	SKP_05.Position = Vector3.new(0.1, 0, 0)
	local SKP_06 = Instance.new('Attachment', SKP_02)
	SKP_06.Position = Vector3.new(-0.1, 0, 0)

	
	if SKP_arg4 then
		local SKP_07 = Instance.new('Trail', SKP_02)
		SKP_07.Attachment0 = SKP_05
		SKP_07.Attachment1 = SKP_06
		SKP_07.Transparency = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 0, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)
		SKP_07.WidthScale = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 2, 0);
				NumberSequenceKeypoint.new(1, 0);
			}
		)
		SKP_07.Texture = "rbxassetid://232918622"
		SKP_07.TextureMode = Enum.TextureMode.Stretch
		SKP_07.LightEmission = 1
		SKP_07.Lifetime = 0.2
		SKP_07.FaceCamera = true
		SKP_07.Color = ColorSequence.new(SKP_arg8)
	end

	if SKP_arg10 then
	local SKP_08 = Instance.new("BillboardGui", SKP_02)
		SKP_08.Adornee = SKP_02
		local SKP_09 = math.random(375, 475)/10
		SKP_08.Size = UDim2.new(SKP_09, 0, SKP_09, 0)
		SKP_08.LightInfluence = 0
		local SKP_010 = Instance.new("ImageLabel", SKP_08)
		SKP_010.BackgroundTransparency = 1
		SKP_010.Size = UDim2.new(1, 0, 1, 0)
		SKP_010.Position = UDim2.new(0, 0, 0, 0)
		SKP_010.Image = "http://www.roblox.com/asset/?id=1047066405"
		SKP_010.ImageColor3 = SKP_arg11

		SKP_010.ImageTransparency = math.random(2, 5)/15
		
		if SKP_02:FindFirstChild("BillboardGui") ~= nil then
			SKP_02.BillboardGui.Enabled = true
		end
	end

	local SKP_011 = {SKP_arg1.Character,SKP_02,workspace.ACS_WorkSpace}
	while true do
		RS.Heartbeat:wait()
		local SKP_012 = Ray.new(SKP_02.Position, SKP_02.CFrame.LookVector*25)
		local SKP_013, SKP_014 = workspace:FindPartOnRayWithIgnoreList(SKP_012, SKP_011, false, true)
		if SKP_013 then
			game.Debris:AddItem(SKP_02,0)
			break
		end
	end
	game.Debris:AddItem(SKP_02,0)
	return SKP_02
end
end)

Human.StateChanged:connect(onStateChanged)

Evt.ACS_AI.AIBullet.OnClientEvent:Connect(function(SKP_arg1,SKP_arg3,SKP_arg4,SKP_arg5,SKP_arg6,SKP_arg7,SKP_arg8,SKP_arg9,SKP_arg10,SKP_arg11,SKP_arg12)
if SKP_arg1 ~= Jogador then 
local SKP_01 = SKP_arg3
	local SKP_02 = Instance.new("Part")
	SKP_02.Parent = workspace.ACS_WorkSpace.Server
	SKP_02.Name = "AI_Bullet"
	Debris:AddItem(SKP_02, 5)
	SKP_02.Shape = "Ball"
	SKP_02.Size = Vector3.new(1, 1, 1)
	SKP_02.CanCollide = false
	SKP_02.CFrame = SKP_01
	SKP_02.Transparency = 1

	local SKP_03 = SKP_02:GetMass()
	local SKP_04 = Instance.new('BodyForce', SKP_02)
	
	SKP_04.Force = Vector3.new(0,SKP_03 * (196.2) - SKP_arg5 * (196.2), 0)
	SKP_02.Velocity = SKP_arg7 * SKP_arg6

	local SKP_05 = Instance.new('Attachment', SKP_02)
	SKP_05.Position = Vector3.new(0.1, 0, 0)
	local SKP_06 = Instance.new('Attachment', SKP_02)
	SKP_06.Position = Vector3.new(-0.1, 0, 0)

	
	if SKP_arg4 then
		local SKP_07 = Instance.new('Trail', SKP_02)
		SKP_07.Attachment0 = SKP_05
		SKP_07.Attachment1 = SKP_06
		SKP_07.Transparency = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 0, 0);
				NumberSequenceKeypoint.new(1, 1);
			}
		)
		SKP_07.WidthScale = NumberSequence.new({
				NumberSequenceKeypoint.new(0, 2, 0);
				NumberSequenceKeypoint.new(1, 0);
			}
		)
		SKP_07.Texture = "rbxassetid://232918622"
		SKP_07.TextureMode = Enum.TextureMode.Stretch
		SKP_07.LightEmission = 1
		SKP_07.Lifetime = 0.2
		SKP_07.FaceCamera = true
		SKP_07.Color = ColorSequence.new(SKP_arg8)
	end

	if SKP_arg10 then
	local SKP_08 = Instance.new("BillboardGui", SKP_02)
		SKP_08.Adornee = SKP_02
		local SKP_09 = math.random(375, 475)/10
		SKP_08.Size = UDim2.new(SKP_09, 0, SKP_09, 0)
		SKP_08.LightInfluence = 0
		local SKP_010 = Instance.new("ImageLabel", SKP_08)
		SKP_010.BackgroundTransparency = 1
		SKP_010.Size = UDim2.new(1, 0, 1, 0)
		SKP_010.Position = UDim2.new(0, 0, 0, 0)
		SKP_010.Image = "http://www.roblox.com/asset/?id=1047066405"
		SKP_010.ImageColor3 = SKP_arg11

		SKP_010.ImageTransparency = math.random(2, 5)/15
		
		if SKP_02:FindFirstChild("BillboardGui") ~= nil then
			SKP_02.BillboardGui.Enabled = true
		end
	end

	local SKP_011 = {SKP_02,workspace.ACS_WorkSpace}
	while true do
		RS.Heartbeat:wait()
		local SKP_012 = Ray.new(SKP_02.Position, SKP_02.CFrame.LookVector*25)
		local SKP_013, SKP_014 = workspace:FindPartOnRayWithIgnoreList(SKP_012, SKP_011, false, true)
		if SKP_013 then
			game.Debris:AddItem(SKP_02,0)
			break
		end
	end
	game.Debris:AddItem(SKP_02,0)
	return SKP_02
end
end)

Evt.ACS_AI.AIShoot.OnClientEvent:Connect(function(Gun)

	for _, v in pairs(Gun.Muzzle:GetChildren()) do
				if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
					v.Enabled = true
					end
				end

		delay(1 / 30, function()

			for _, v in pairs(Gun.Muzzle:GetChildren()) do
				if v.Name:sub(1, 7) == "FlashFX" or v.Name:sub(1, 7) == "Smoke" then
					v.Enabled = false
				end
			end
		end)		
	
end)
