----------------------------------------------------------------------------------------------
------------------------------------[TECLAS]--------------------------------------------------
----------------------------------------------------------------------------------------------



local Laserdebounce = false

Mouse.KeyDown:connect(function(key)
if (key == "v") and Equipped and Settings.FireModes.ChangeFiremode  then
	FireMode()
end
if (key == "t") and Equipped and (not NVG or ArmaClone.AimPart:FindFirstChild("NVAim") == nil) then
	if Aiming then
		if ArmaClone:FindFirstChild("AimPart2") ~= nil then
			if AimPartMode == 1 then
				AimPartMode = 2
				tweenFoV(Settings.ChangeFOV[2],120)
				if Settings.FocusOnSight2 and Aiming 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
				if Settings.ZoomAnim then
					ZoomAnim()
					Sprint()
				end
			elseif AimPartMode == 2 then
				AimPartMode = 1
				tweenFoV(Settings.ChangeFOV[1],120)
				if Settings.FocusOnSight and Aiming 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
				if Settings.ZoomAnim then
					UnZoomAnim()
					Sprint()
				end
			end
		else
			if AimPartMode == 1 then
				AimPartMode = 2
				tweenFoV(Settings.ChangeFOV[2], 120)
				if Settings.FocusOnSight2 and Aiming 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
				if Settings.ZoomAnim then
					ZoomAnim()
					Sprint()
				end
			elseif AimPartMode == 2 then
				AimPartMode = 1
				tweenFoV(Settings.ChangeFOV[1], 120)
				if Settings.FocusOnSight and Aiming 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
				if Settings.ZoomAnim then
					UnZoomAnim()
					Sprint()
				end
			end
		end
	else
		if AimPartMode == 1 then
			AimPartMode = 2
			if Settings.FocusOnSight2 and Aiming 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
			if Settings.ZoomAnim then
				ZoomAnim()
				Sprint()
			end
		elseif AimPartMode == 2 then
			AimPartMode = 1
			if Settings.FocusOnSight and Aiming 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
			if Settings.ZoomAnim then
				UnZoomAnim()
				Sprint()
			end
		end
	end
end
if (key == "[") and Equipped then
	if Zeroing.Value > Zeroing.MinValue then
		Zeroing.Value = Zeroing.Value - 50
		ArmaClone.Handle.Click:play()
		Update_Gui()
	end
end
if (key == "]" ) and Equipped then
	if Zeroing.Value < Zeroing.MaxValue then
		Zeroing.Value = Zeroing.Value + 50
		ArmaClone.Handle.Click:play()
		Update_Gui()
	end
end
if (key == "r") and Equipped and stance > -2 then
	Reload()
end
if (key == "f") and Equipped and not Reloading and stance > -2  then
	Chamber()
end
if (key == "m") and Equipped and Settings.CanCheckMag and not Reloading and stance > -2 then
			MouseHeld = false
			Can_Shoot = false
			Reloading = true

			if Safe then
				Safe = false
				stance = 0
				Evt.Stance:FireServer(stance,Settings,Anims)
				IdleAnim()
				Update_Gui()
				--wait(.25)
			end
			CheckAnim()
			Sprint()			
			Update_Gui()		
			Can_Shoot = true
			Reloading = false
end
if (key == "h") and Equipped and ArmaClone:FindFirstChild("LaserPoint") then


	if ServerConfig.RealisticLaser and ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
		if not LaserAtivo and not IRmode then
			LaserAtivo = not LaserAtivo
			IRmode = not IRmode

			if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon
				
				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end
				
				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint				

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint
				
				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end

			elseif LaserAtivo and IRmode then
			IRmode = not IRmode
		elseif LaserAtivo and not IRmode then
			LaserAtivo = not LaserAtivo

			if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon
				
				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end
				
				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint				

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint
				
				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end


		end
	else
		LaserAtivo = not LaserAtivo

		if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon
				
				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end
				
				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint				

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint
				
				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end

	end
	ArmaClone.Handle.Click:play()


end
if (key == "j") and Equipped and ArmaClone:FindFirstChild("FlashPoint") then
	LanternaAtiva = not LanternaAtiva
	ArmaClone.Handle.Click:play()
			if LanternaAtiva then
				Evt.SVFlash:FireServer(true,ArmaClient,ArmaClone.FlashPoint.Light.Angle,ArmaClone.FlashPoint.Light.Brightness,ArmaClone.FlashPoint.Light.Color,ArmaClone.FlashPoint.Light.Range)
				ArmaClone.FlashPoint.Light.Enabled = true
			else
				Evt.SVFlash:FireServer(false,ArmaClient,nil,nil,nil,nil)
				ArmaClone.FlashPoint.Light.Enabled = false
			end
end
if (key == "u") and Equipped and ArmaClone:FindFirstChild("Silenciador") then
	Silencer.Value = not Silencer.Value
	ArmaClone.Handle.Click:play()
			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
if (key == "b") and Equipped and BipodEnabled and ArmaClone:FindFirstChild("BipodPoint") then
	Bipod = not Bipod
	if Bipod == true then
		if ArmaClone.BipodPoint:FindFirstChild("BipodDeploy") ~= nil then
			ArmaClone.BipodPoint.BipodDeploy:play()
		end
	else
		if ArmaClone.BipodPoint:FindFirstChild("BipodRetract") ~= nil then
			ArmaClone.BipodPoint.BipodRetract:play()
		end
	end
end
if (key == "n") and Laserdebounce == false then

		if Player.Character then
		local helmet = Player.Character:FindFirstChild("Helmet")
		if helmet then
			local nvg = helmet:FindFirstChild("Up")
			if nvg then
				Laserdebounce = true
				delay(.8,function()
					NVG = not NVG 

		if Aiming and ArmaClone.AimPart:FindFirstChild("NVAim") ~= nil then
		if NVG then
			tweenFoV(70,120)
			TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
		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
	end	
	Laserdebounce = false		
end)
			
				end
			end
		end
	end
end)