HeadBase=Instance.new("\080\097\114\116")HeadBase.Name="\066\097\115\101\080\097\114\116"HeadBase.Parent=Camera HeadBase.Anchored=true HeadBase.CanCollide=false HeadBase.Transparency=1 HeadBase.Size=Vector3.new(.1,.1,.1)HeadBaseAtt=Instance.new("\065\116\116\097\099\104\109\101\110\116")HeadBaseAtt.Parent=HeadBase local Y=PastaHUD:WaitForChild("\083\116\097\116\117\115\085\073")local s=Y:Clone()s.Parent=Jogador.PlayerGui if ServerConfig.EnableHunger then s.FomeSede.Disabled=false end if ServerConfig.EnableGPS then local Y=PastaHUD:WaitForChild("\071\080\083\104\117\100")local s=Y:Clone()s.Parent=Jogador.PlayerGui s.GPS.Disabled=false end function ResetWorkspace()Ignore_Model:ClearAllChildren()BulletModel:ClearAllChildren()workspace.Terrain:ClearAllChildren()end ResetWorkspace()Evt.Hit.OnClientEvent:Connect(function(Y,s,G,U,n,X)if Y~=Jogador then Hitmarker.HitEffect(Ray_Ignore,ACS_Storage,s,G,U,n,X)end end)Evt.HeadRot.OnClientEvent:Connect(function(Y,s,G,U)if Y~=Jogador and(Y.Character and Y.Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")~=nil)then local U=(Y.Character.HumanoidRootPart.CFrame*CFrame.new(0,1.5,0))*CFrame.new(G);(Y.Character.Torso:WaitForChild("\078\101\099\107")).C0=Y.Character.Torso.CFrame:toObjectSpace(U);(Y.Character.Torso:WaitForChild("\078\101\099\107")).C1=CFrame.Angles(s,0,0)end end)Evt.Atirar.OnClientEvent:Connect(function(Y,s,G,U)if Y~=Jogador then if Y.Character:FindFirstChild("\083"..U.Name)~=nil and Y.Character["\083"..U.Name].Grip:FindFirstChild("\077\117\122\122\108\101")~=nil then local s=Y.Character["\083"..U.Name].Grip:FindFirstChild("\077\117\122\122\108\101")if Y.Character["\083"..U.Name]:FindFirstChild("\083\105\108\101\110\099\105\097\100\111\114")~=nil and Y.Character["\083"..U.Name].Silenciador.Transparency==0 then(s:FindFirstChild("\070\108\097\115\104\070\088")).Brightness=0;(s:FindFirstChild("\070\108\097\115\104\070\088\091\070\108\097\115\104\093")).Rate=0 else(s:FindFirstChild("\070\108\097\115\104\070\088")).Brightness=5;(s:FindFirstChild("\070\108\097\115\104\070\088\091\070\108\097\115\104\093")).Rate=1000 end for Y,s in pairs(s:GetChildren())do if s.Name:sub(1,7)=="\070\108\097\115\104\070\088"or s.Name:sub(1,7)=="\083\109\111\107\101"then s.Enabled=true end end delay(.033333333333333,function()for Y,s in pairs(s:GetChildren())do if s.Name:sub(1,7)=="\070\108\097\115\104\070\088"or s.Name:sub(1,7)=="\083\109\111\107\101"then s.Enabled=false end end end)end if Y.Character:FindFirstChild("\065\110\105\109\066\097\115\101")~=nil and Y.Character.AnimBase:FindFirstChild("\065\110\105\109\066\097\115\101\087")then local U=(Y.Character:WaitForChild("\065\110\105\109\066\097\115\101")):WaitForChild("\065\110\105\109\066\097\115\101\087");(TS:Create(U,TweenInfo.new(s),{C1=G.ShootPos})):Play()wait(s*2);(TS:Create(U,TweenInfo.new(.2),{C1=CFrame.new()})):Play()end end end)function Setup(Y)local s=Character:FindFirstChild("\084\111\114\115\111")local G=Character:FindFirstChild("\072\101\097\100")local U=Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")ArmaClient=Y ArmaClone=(GunModelClient:WaitForChild(ArmaClient.Name)):Clone()Var=Y.ACS_Modulo.Variaveis Settings=require(Var:WaitForChild("\083\101\116\116\105\110\103\115"))Anims=require(Var:WaitForChild("\065\110\105\109\097\116\105\111\110\115"))VRecoil=math.random(Settings.VRecoil[1],Settings.VRecoil[2])/1000 HRecoil=math.random(Settings.HRecoil[1],Settings.HRecoil[2])/1000 VPunchBase=Settings.VPunchBase HPunchBase=Settings.HPunchBase DPunchBase=Settings.DPunchBase RecoilPower=Settings.MinRecoilPower BSpread=Settings.MinSpread Silencer=Var.Suppressor Ammo,StoredAmmo,GLAmmo=Var.Ammo,Var.StoredAmmo,Var.LauncherAmmo Chambered,Emperrado,GLChambered=Var.Chambered,Var.Emperrado,Var.GLChambered FireRate=1/(Settings.FireRate/60)BurstFireRate=1/(Settings.BurstFireRate/60)ModoTreino=Settings.ModoTreino Sens=Var.Sens Zeroing=Var.Zeroing Evt.Equipar:FireServer(ArmaClient,Settings)Folder=Instance.new("\077\111\100\101\108",Camera)Folder.Name=Y.Name AnimBase=Instance.new("\080\097\114\116",Folder)AnimBase.FormFactor="\067\117\115\116\111\109"AnimBase.CanCollide=false AnimBase.Transparency=1 AnimBase.Anchored=true AnimBase.Name="\065\110\105\109\066\097\115\101"AnimBase.Size=Vector3.new(.1,.1,.1)AnimBaseW=Instance.new("\077\111\116\111\114\054\068")AnimBaseW.Part0=AnimBase AnimBaseW.Part1=HeadBase AnimBaseW.Parent=AnimBase AnimBaseW.Name="\065\110\105\109\066\097\115\101\087"AnimBase.Anchored=false Clone=Instance.new("\077\111\116\111\114\054\068")Clone.Name="\067\108\111\110\101"Clone.Parent=AnimBase Clone.Part0=AnimBase Clone.Part1=HeadBase ArmaClone.Parent=Folder for Y,s in pairs(ArmaClone:GetChildren())do if s:IsA("\066\097\115\101\080\097\114\116")and s.Name~="\072\097\110\100\108\101"then if s.Name~="\066\111\108\116"and s.Name~="\076\105\100"then Ultil.Weld(s,ArmaClone:WaitForChild("\072\097\110\100\108\101"))end if s.Name=="\066\111\108\116"or s.Name=="\083\108\105\100\101"then Ultil.WeldComplex(ArmaClone:WaitForChild("\072\097\110\100\108\101"),s,s.Name)end if s.Name=="\076\105\100"then if ArmaClone:FindFirstChild("\076\105\100\072\105\110\103\101")then Ultil.Weld(s,ArmaClone:WaitForChild("\076\105\100\072\105\110\103\101"))else Ultil.Weld(s,ArmaClone:WaitForChild("\072\097\110\100\108\101"))end end end end for Y,s in pairs(ArmaClone:GetChildren())do if s:IsA("\066\097\115\101\080\097\114\116")and s.Name~="\071\114\105\112"then s.Anchored=false s.CanCollide=false end end RA,LA,Right_Weld,Left_Weld,AnimBase,AnimBaseW=SetupMod(Folder,Ultil,Character,RA,LA,Right_Weld,Left_Weld,AnimBase,AnimBaseW,Settings,ArmaClone)Equipped=true if ArmaClone:FindFirstChild("\083\105\108\101\110\099\105\097\100\111\114")~=nil then if Silencer.Value==true then ArmaClone.Silenciador.Transparency=0 ArmaClone.SmokePart.FlashFX.Brightness=0;(ArmaClone.SmokePart:FindFirstChild("\070\108\097\115\104\070\088\091\070\108\097\115\104\093")).Rate=0 Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)else ArmaClone.Silenciador.Transparency=1 ArmaClone.SmokePart.FlashFX.Brightness=5;(ArmaClone.SmokePart:FindFirstChild("\070\108\097\115\104\070\088\091\070\108\097\115\104\093")).Rate=1000 Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)end end end function Unset()if ArmaClient then Evt.Desequipar:FireServer(ArmaClient,Settings)end UnloadClientMods()if Folder then Folder:Destroy()end Equipped=false Aiming=false Safe=false Bipod=false LanternaAtiva=false IRmode=false LaserAtivo=false CancelReload=false Reloading=false slideback=false OverHeat=false uis.MouseIconEnabled=true;(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).MouseDeltaSensitivity=1 Camera.CameraType=Enum.CameraType.Custom Player.CameraMode=Enum.CameraMode.Classic AimPartMode=1 stance=0 tweenFoV(70,15);(TS:Create(s.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)if Gui then Gui.Visible=false end for Y,s in pairs(Connections)do s:disconnect()end Connections={}Walking=false a=false d=false end function Update_Gui()if CanUpdateGui then if ArmaClone:FindFirstChild("\066\105\112\111\100\080\111\105\110\116")~=nil then Gui.Bipod.Visible=true else Gui.Bipod.Visible=false end if Settings.ArcadeMode==true then Gui.Ammo.Visible=true Gui.Ammo.AText.Text=Ammo.Value..("\124"..Settings.Ammo)else Gui.Ammo.Visible=false end if Settings.FireModes.Explosive==true and GLChambered.Value==true then Gui.E.ImageColor3=Color3.fromRGB(255,255,255)Gui.E.Visible=true elseif Settings.FireModes.Explosive==true and GLChambered.Value==false then Gui.E.ImageColor3=Color3.fromRGB(255,0,0)Gui.E.Visible=true elseif Settings.FireModes.Explosive==false then Gui.E.Visible=false end if Safe==true then Gui.A.Visible=true else Gui.A.Visible=false end if Chambered.Value==true and(Ammo.Value>0 and Emperrado.Value==false)then Gui.B.Visible=true Gui.B.BackgroundColor3=Color3.fromRGB(255,255,255)elseif Chambered.Value==true and(Ammo.Value>0 and Emperrado.Value==true)then Gui.B.Visible=true Gui.B.BackgroundColor3=Color3.fromRGB(255,0,0)else Gui.B.Visible=false end Gui.FText.Text=Settings.Mode if Settings.Mode~="\069\120\112\108\111\115\105\118\101"then Gui.BText.Text=Settings.BulletType else Gui.BText.Text="\072\069\068\080"end Gui.Sens.Text=Sens.Value/100 Gui.ZeText.Text=Zeroing.Value.." \109"Gui.NText.Text=Settings.Name if Settings.Mode~="\069\120\112\108\111\115\105\118\101"then if Settings.MagCount then Gui.SAText.Text=math.ceil(StoredAmmo.Value/Settings.Ammo)else Gui.SAText.Text=StoredAmmo.Value end else Gui.SAText.Text=GLAmmo.Value end if Silencer.Value==true then Gui.Silencer.Visible=true else Gui.Silencer.Visible=false end if LaserAtivo==true then Gui.Laser.Visible=true if IRmode then Gui.Laser.ImageColor3=Color3.new(0,255,0)else Gui.Laser.ImageColor3=Color3.new(255,255,255)end else Gui.Laser.Visible=false end if LanternaAtiva==true then Gui.Flash.Visible=true else Gui.Flash.Visible=false end end end function CheckMagFunction()if CanUpdateGui then Gui.CMText.TextTransparency=0 Gui.CMText.TextStrokeTransparency=.9 if Ammo.Value>=Settings.Ammo then Gui.CMText.Text="\070\117\108\108"elseif Ammo.Value>math.floor(Settings.Ammo*.75)and Ammo.Value<Settings.Ammo then Gui.CMText.Text="\078\101\097\114\108\121 \102\117\108\108"elseif Ammo.Value<math.floor(Settings.Ammo*.75)and Ammo.Value>math.floor(Settings.Ammo*.5)then Gui.CMText.Text="\065\108\109\111\115\116 \104\097\108\102"elseif Ammo.Value==math.floor(Settings.Ammo*.5)then Gui.CMText.Text="\072\097\108\102"elseif Ammo.Value>math.ceil(Settings.Ammo*.25)and Ammo.Value<math.floor(Settings.Ammo*.5)then Gui.CMText.Text="\076\101\115\115 \116\104\097\110 \104\097\108\102"elseif Ammo.Value<math.ceil(Settings.Ammo*.25)and Ammo.Value>0 then Gui.CMText.Text="\065\108\109\111\115\116 \101\109\112\116\121"elseif Ammo.Value==0 then Gui.CMText.Text="\069\109\112\116\121"end;(TS:Create(Gui.CMText,TweenInfo.new(10),{TextTransparency=1,TextStrokeTransparency=1})):Play()end end Evt.Stance.OnClientEvent:Connect(function(Y,s,G,U)if Y.Character.Humanoid.Health>0 and(Y.Character.AnimBase:FindFirstChild("\082\065\087")~=nil and Y.Character.AnimBase:FindFirstChild("\076\065\087")~=nil)then local n=Y.Character.AnimBase:WaitForChild("\082\065\087")local X=Y.Character.AnimBase:WaitForChild("\076\065\087")if s==0 then(TS:Create(n,TweenInfo.new(.3),{C0=G.RightArmPos})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=G.LeftArmPos})):Play()elseif s==2 then(TS:Create(n,TweenInfo.new(.3),{C0=U.RightAim})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=U.LeftAim})):Play()elseif s==1 then(TS:Create(n,TweenInfo.new(.3),{C0=U.RightHighReady})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=U.LeftHighReady})):Play()elseif s==-1 then(TS:Create(n,TweenInfo.new(.3),{C0=U.RightLowReady})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=U.LeftLowReady})):Play()elseif s==-2 then(TS:Create(n,TweenInfo.new(.3),{C0=U.RightPatrol})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=U.LeftPatrol})):Play()elseif s==3 then(TS:Create(n,TweenInfo.new(.3),{C0=U.RightSprint})):Play();(TS:Create(X,TweenInfo.new(.3),{C0=U.LeftSprint})):Play()end end end)function Sprint()if Equipped then if Correndo and SpeedPrecision>0 then MouseHeld=false if Aiming then(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(s.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency=1})):Play()end if not Safe and not AnimDebounce then stance=3 Evt.Stance:FireServer(stance,Settings,Anims)SprintAnim()end elseif not Correndo or SpeedPrecision==0 then if not Safe and not AnimDebounce then if Aiming then stance=2 Evt.Stance:FireServer(stance,Settings,Anims)IdleAnim()else stance=0 Evt.Stance:FireServer(stance,Settings,Anims)IdleAnim()end end end end end Sprinting.Changed:connect(function(Y)Correndo=Y Sprint()end)


	HeadBase = Instance.new('Part')
	HeadBase.Name = 'BasePart'
	HeadBase.Parent = Camera
	HeadBase.Anchored = true
	HeadBase.CanCollide = false
	HeadBase.Transparency = 1
	HeadBase.Size = Vector3.new(0.1, 0.1, 0.1)

	HeadBaseAtt = Instance.new('Attachment')
	HeadBaseAtt.Parent = HeadBase
	


	local StatusUI = PastaHUD:WaitForChild("StatusUI")
	local StatusClone = StatusUI:Clone()
	StatusClone.Parent = Jogador.PlayerGui
	
	if ServerConfig.EnableHunger then
		StatusClone.FomeSede.Disabled = false
	end

if ServerConfig.EnableGPS then
	local StatusUI = PastaHUD:WaitForChild("GPShud")
	local StatusClone = StatusUI:Clone()
	StatusClone.Parent = Jogador.PlayerGui
	StatusClone.GPS.Disabled = false
end

function ResetWorkspace()
	Ignore_Model:ClearAllChildren()
	BulletModel:ClearAllChildren()
	workspace.Terrain:ClearAllChildren()
end

ResetWorkspace()

Evt.Hit.OnClientEvent:Connect(function(Player,Position, HitPart, Normal, Material,Settings)
	if Player ~= Jogador then 
		Hitmarker.HitEffect(Ray_Ignore,ACS_Storage,Position, HitPart, Normal, Material,Settings)
	end
end)

Evt.HeadRot.OnClientEvent:Connect(function(Player, Rotacao, Offset, Equipado)
	if Player ~= Jogador and Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") ~= nil then
		local HRPCF =  Player.Character["HumanoidRootPart"].CFrame * CFrame.new(0, 1.5, 0) * CFrame.new(Offset)
		Player.Character.Torso:WaitForChild("Neck").C0 =  Player.Character.Torso.CFrame:toObjectSpace(HRPCF)
		Player.Character.Torso:WaitForChild("Neck").C1 =  CFrame.Angles(Rotacao, 0, 0)
	end
end)

Evt.Atirar.OnClientEvent:Connect(function(Player,FireRate,Anims,Arma)

if Player ~= Jogador then 

	if Player.Character:FindFirstChild('S' .. Arma.Name) ~= nil and Player.Character['S' .. Arma.Name].Grip:FindFirstChild("Muzzle") ~= nil then
		local Muzzle = Player.Character['S' .. Arma.Name].Grip:FindFirstChild("Muzzle")
		
		if  Player.Character['S' .. Arma.Name]:FindFirstChild("Silenciador") ~= nil and Player.Character['S' .. Arma.Name].Silenciador.Transparency == 0 then
				Muzzle:FindFirstChild("FlashFX").Brightness = 0
				Muzzle:FindFirstChild("FlashFX[Flash]").Rate = 0
			else
				Muzzle:FindFirstChild("FlashFX").Brightness = 5
				Muzzle:FindFirstChild("FlashFX[Flash]").Rate = 1000
			end


		for _, v in pairs(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(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
 	if  Player.Character:FindFirstChild("AnimBase") ~= nil and Player.Character.AnimBase:FindFirstChild("AnimBaseW") then
		local AnimBase = Player.Character:WaitForChild("AnimBase"):WaitForChild("AnimBaseW")

		TS:Create(AnimBase, TweenInfo.new(FireRate), {C1 = Anims.ShootPos} ):Play()
		wait(FireRate*2)
		TS:Create(AnimBase, TweenInfo.new(.2), {C1 = CFrame.new()} ):Play()
	end
end
end)

function Setup(Tools)
	
	local Torso = Character:FindFirstChild('Torso')
	local Head = Character:FindFirstChild('Head')
	local HumanoidRootPart = Character:FindFirstChild('HumanoidRootPart')

	ArmaClient = Tools
	ArmaClone = GunModelClient:WaitForChild(ArmaClient.Name):Clone()
	Var = Tools.ACS_Modulo.Variaveis
	Settings = require(Var:WaitForChild("Settings"))
	Anims = require(Var:WaitForChild("Animations"))
	
	 VRecoil = math.random(Settings.VRecoil[1],Settings.VRecoil[2])/1000
	 HRecoil = math.random(Settings.HRecoil[1],Settings.HRecoil[2])/1000
	 VPunchBase = (Settings.VPunchBase)
	 HPunchBase = (Settings.HPunchBase)
	 DPunchBase = (Settings.DPunchBase)
	 RecoilPower = Settings.MinRecoilPower
	 BSpread = Settings.MinSpread

	 Silencer = Var.Suppressor
	 Ammo, StoredAmmo, GLAmmo = Var.Ammo, Var.StoredAmmo, Var.LauncherAmmo
	 Chambered,Emperrado,GLChambered = Var.Chambered, Var.Emperrado, Var.GLChambered
	 FireRate = 1/(Settings.FireRate/60)
	 BurstFireRate = 1/(Settings.BurstFireRate/60)

	 ModoTreino = Settings.ModoTreino

	 Sens = Var.Sens
	 Zeroing = Var.Zeroing


	Evt.Equipar:FireServer(ArmaClient,Settings)

 	Folder = Instance.new("Model", Camera)
	Folder.Name = Tools.Name

	AnimBase = Instance.new("Part", Folder)
	AnimBase.FormFactor = "Custom"
	AnimBase.CanCollide = false
	AnimBase.Transparency = 1
	AnimBase.Anchored = true
	AnimBase.Name = "AnimBase"
	AnimBase.Size = Vector3.new(0.1, 0.1, 0.1)
	
	AnimBaseW = Instance.new("Motor6D")
	AnimBaseW.Part0 = AnimBase
	AnimBaseW.Part1 = HeadBase
	AnimBaseW.Parent = AnimBase
	AnimBaseW.Name = "AnimBaseW"
	AnimBase.Anchored = false

	Clone = Instance.new('Motor6D')
	Clone.Name = 'Clone'
	Clone.Parent = AnimBase
	Clone.Part0 = AnimBase
	Clone.Part1 = HeadBase


	ArmaClone.Parent = Folder


	for L_209_forvar1, L_210_forvar2 in pairs(ArmaClone:GetChildren()) do
		if L_210_forvar2:IsA('BasePart') and L_210_forvar2.Name ~= 'Handle' then
			if L_210_forvar2.Name ~= "Bolt" and L_210_forvar2.Name ~= 'Lid' then
				Ultil.Weld(L_210_forvar2, ArmaClone:WaitForChild("Handle"))
			end
			
			if L_210_forvar2.Name == "Bolt" or L_210_forvar2.Name == "Slide" then
				Ultil.WeldComplex(ArmaClone:WaitForChild("Handle"), L_210_forvar2, L_210_forvar2.Name)
			end;
			
			if L_210_forvar2.Name == "Lid" then
				if ArmaClone:FindFirstChild('LidHinge') then
					Ultil.Weld(L_210_forvar2, ArmaClone:WaitForChild("LidHinge"))
				else
					Ultil.Weld(L_210_forvar2, ArmaClone:WaitForChild("Handle"))
				end
			end
		end
	end;

	for L_213_forvar1, L_214_forvar2 in pairs(ArmaClone:GetChildren()) do
		if L_214_forvar2:IsA('BasePart') and L_214_forvar2.Name ~= 'Grip' then
			L_214_forvar2.Anchored = false
			L_214_forvar2.CanCollide = false
		end
	end;
	--LoadClientMods()
	RA, LA, Right_Weld, Left_Weld, AnimBase, AnimBaseW = SetupMod(Folder, Ultil, Character, RA, LA, Right_Weld, Left_Weld, AnimBase, AnimBaseW, Settings, ArmaClone)
	Equipped = true
	if ArmaClone:FindFirstChild('Silenciador')~= nil then
		if Silencer.Value == true then
			ArmaClone.Silenciador.Transparency = 0
			ArmaClone.SmokePart.FlashFX.Brightness = 0
			ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 0
			Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)
		else
			ArmaClone.Silenciador.Transparency = 1
			ArmaClone.SmokePart.FlashFX.Brightness = 5
			ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 1000
			Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)
		end
	end
end

function Unset()

	if ArmaClient then
	Evt.Desequipar:FireServer(ArmaClient,Settings)
	end
	UnloadClientMods()
	
	if Folder then
		Folder:Destroy()
	end
	Equipped = false
	Aiming = false
	Safe = false
	Bipod = false
	LanternaAtiva = false
	IRmode = false
	LaserAtivo = false
	--Silencer = false
	CancelReload = false
	Reloading = false
	slideback = false
	OverHeat = false
	uis.MouseIconEnabled = true
	game:GetService('UserInputService').MouseDeltaSensitivity = 1
	Camera.CameraType = Enum.CameraType.Custom
	Player.CameraMode = Enum.CameraMode.Classic
	AimPartMode = 1
	stance = 0
	tweenFoV(70,15)
	TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
	Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
	if Gui then
		Gui.Visible = false
	end

	for _,c in pairs(Connections) do
			c:disconnect()
		end
		Connections = {}
		Walking = false
		a = false
		d = false
end

function Update_Gui()
	if CanUpdateGui then
				
		if ArmaClone:FindFirstChild("BipodPoint") ~= nil then
			Gui.Bipod.Visible = true
		else
			Gui.Bipod.Visible = false
		end

		if Settings.ArcadeMode == true then
			Gui.Ammo.Visible = true
			Gui.Ammo.AText.Text = Ammo.Value.."|"..Settings.Ammo
		else
			Gui.Ammo.Visible = false
		end

		if Settings.FireModes.Explosive == true and GLChambered.Value == true then
			Gui.E.ImageColor3 = Color3.fromRGB(255,255,255)
			Gui.E.Visible = true
		elseif Settings.FireModes.Explosive == true and GLChambered.Value == false then
			Gui.E.ImageColor3 = Color3.fromRGB(255,0,0)
			Gui.E.Visible = true
		elseif Settings.FireModes.Explosive == false then
			Gui.E.Visible = false
		end

		if Safe == true then
			Gui.A.Visible = true
		else
			Gui.A.Visible = false
		end

		if Chambered.Value == true and Ammo.Value > 0 and Emperrado.Value == false then
			Gui.B.Visible = true
			Gui.B.BackgroundColor3 = Color3.fromRGB(255,255,255)
		elseif Chambered.Value == true and Ammo.Value > 0 and Emperrado.Value == true then
			Gui.B.Visible = true
			Gui.B.BackgroundColor3 = Color3.fromRGB(255,0,0)
		else
			Gui.B.Visible = false
		end
		Gui.FText.Text = Settings.Mode
		
		if Settings.Mode ~= "Explosive" then
			Gui.BText.Text = Settings.BulletType
		else
			Gui.BText.Text = "HEDP"
		end
		Gui.Sens.Text = (Sens.Value/100)
		Gui.ZeText.Text = Zeroing.Value .." m"
		Gui.NText.Text = Settings.Name

		if Settings.Mode ~= "Explosive" then
			if Settings.MagCount then
				Gui.SAText.Text = math.ceil(StoredAmmo.Value/Settings.Ammo)
			else
				Gui.SAText.Text = StoredAmmo.Value
			end
		else
			Gui.SAText.Text =  GLAmmo.Value
		end

		if Silencer.Value == true then
			Gui.Silencer.Visible = true
		else
			Gui.Silencer.Visible = false
		end

		if LaserAtivo == true then
			Gui.Laser.Visible = true
			if IRmode then
				Gui.Laser.ImageColor3 = Color3.new(0,255,0)
			else
				Gui.Laser.ImageColor3 = Color3.new(255,255,255)
			end
		else
			Gui.Laser.Visible = false
		end

		if LanternaAtiva == true then
			Gui.Flash.Visible = true
		else
			Gui.Flash.Visible = false
		end

	end
end

function CheckMagFunction()
	if CanUpdateGui then
		Gui.CMText.TextTransparency = 0
		Gui.CMText.TextStrokeTransparency = 0.9
		if Ammo.Value >= Settings.Ammo then
			Gui.CMText.Text = "Full"
		elseif Ammo.Value > math.floor((Settings.Ammo)*.75) and Ammo.Value < Settings.Ammo then
			Gui.CMText.Text = "Nearly full"
		elseif Ammo.Value < math.floor((Settings.Ammo)*.75) and Ammo.Value > math.floor((Settings.Ammo)*.5) then
			Gui.CMText.Text = "Almost half"
		elseif Ammo.Value == math.floor((Settings.Ammo)*.5) then
			Gui.CMText.Text = "Half"
		elseif Ammo.Value > math.ceil((Settings.Ammo)*.25) and Ammo.Value <  math.floor((Settings.Ammo)*.5) then
			Gui.CMText.Text = "Less than half"
		elseif Ammo.Value < math.ceil((Settings.Ammo)*.25) and Ammo.Value > 0 then
			Gui.CMText.Text = "Almost empty"
		elseif Ammo.Value == 0 then
			Gui.CMText.Text = "Empty"
		end
		TS:Create(Gui.CMText,TweenInfo.new(10),{TextTransparency = 1,TextStrokeTransparency = 1}):Play()
	end
end

Evt.Stance.OnClientEvent:Connect(function(Player,stance,Settings,Anims)
	if Player.Character.Humanoid.Health > 0 and Player.Character.AnimBase:FindFirstChild("RAW") ~= nil and Player.Character.AnimBase:FindFirstChild("LAW") ~= nil then

		local Right_Weld = Player.Character.AnimBase:WaitForChild("RAW")
		local Left_Weld = Player.Character.AnimBase:WaitForChild("LAW")

		if stance == 0 then
		
			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Settings.RightArmPos} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Settings.LeftArmPos} ):Play()

		elseif stance == 2 then
		
			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightAim} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftAim} ):Play()

		elseif stance == 1 then
		
			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightHighReady} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftHighReady} ):Play()

		elseif stance == -1 then

			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightLowReady} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftLowReady} ):Play()

		elseif stance == -2 then

			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightPatrol} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftPatrol} ):Play()

		elseif stance == 3 then

			TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightSprint} ):Play()
			TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftSprint} ):Play()
		
		end
	end
end)

function Sprint()
if Equipped then
	if Correndo and SpeedPrecision > 0 then
		MouseHeld = false
		if Aiming then
			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
		if not Safe and not AnimDebounce then
		stance = 3
		Evt.Stance:FireServer(stance,Settings,Anims)
		SprintAnim()
		end
	elseif not Correndo or SpeedPrecision == 0 then
		if not Safe and not AnimDebounce then
		if Aiming then
		stance = 2
		Evt.Stance:FireServer(stance,Settings,Anims)
		IdleAnim()
		else
		stance = 0
		Evt.Stance:FireServer(stance,Settings,Anims)
		IdleAnim()
		end
		end
	end
end
end

Sprinting.Changed:connect(function(Valor)
	Correndo = Valor
	Sprint()
end)
