repeat wait()until game:IsLoaded()and(game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)~=nil and game.Players.LocalPlayer.Character:FindFirstChild("\072\117\109\097\110\111\105\100")~=nil)local m=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local C=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local r=require(m.ClientModules.Constants)local v=game.Players.LocalPlayer local Z=v.Character or v.CharacterAdded:Wait()local G=Z:WaitForChild("\072\117\109\097\110\111\105\100")local z=G:WaitForChild("\065\110\105\109\097\116\111\114")local Y,y=nil,nil local A,I=nil,nil IdleAnimation=z:LoadAnimation(m.Animations.Idle)SprintAnimation=z:LoadAnimation(m.Animations.Sprint)CrouchAnimation=z:LoadAnimation(m.Animations.Crouch)local U=false local H=false local O=false local X=false local function K()if H then G.WalkSpeed=16 SprintAnimation:Stop()H=false end if U then G.WalkSpeed=16 CrouchAnimation:Stop()else if O then IdleAnimation:Play()end CrouchAnimation:Play()G.WalkSpeed=10 end U=not U end local function g()if U then G.WalkSpeed=16 CrouchAnimation:Stop()if O then IdleAnimation:Stop()end U=false end if H then G.WalkSpeed=16 if O then SprintAnimation:Stop()IdleAnimation:Play()end else if O then IdleAnimation:Stop()SprintAnimation:Play()end G.WalkSpeed=24 end H=not H end C.InputBegan:Connect(function(m,C)if C then return end if m.KeyCode==r.sprintKey and not X then g()elseif m.KeyCode==r.crouchKey then K()elseif m.KeyCode==Enum.KeyCode.Space then if U then K()end end end)


repeat wait() until game:IsLoaded() and game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") ~= nil

local ReplicatedStorage	= game:GetService("ReplicatedStorage")
local UserInputService	= game:GetService("UserInputService")
local constants			= require(ReplicatedStorage["ClientModules"].Constants)

local player	= game.Players.LocalPlayer
local character	= player.Character or player.CharacterAdded:Wait()
local humanoid	= character:WaitForChild("Humanoid")
local animator	= humanoid:WaitForChild("Animator")
local oldEvent1,oldEvent2	= nil,nil
local toolEvent,toolEventDe	= nil,nil

IdleAnimation 	= animator:LoadAnimation(ReplicatedStorage.Animations.Idle)
SprintAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Sprint)
CrouchAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Crouch)

local crouching	= false
local sprinting	= false
local equipped	= false
local shooting	= false

local function Crouch()
	if sprinting then
		humanoid.WalkSpeed = 16;
		SprintAnimation:Stop()
		sprinting = false
	end
	if crouching then
		humanoid.WalkSpeed = 16
		CrouchAnimation:Stop()
	else
		if equipped then
			IdleAnimation:Play()
		end
		CrouchAnimation:Play()
		humanoid.WalkSpeed = 10
	end
	crouching	= not crouching
end

local function Sprint()
	if crouching then
		humanoid.WalkSpeed = 16
		CrouchAnimation:Stop()
		if equipped then
			IdleAnimation:Stop()
		end
		crouching = false
	end
	if sprinting then
		humanoid.WalkSpeed = 16;
		if equipped then
			SprintAnimation:Stop()
			IdleAnimation:Play()
		end
	else
		if equipped then
			IdleAnimation:Stop()
			SprintAnimation:Play()
		end
		humanoid.WalkSpeed = 24;
	end
	sprinting		= not sprinting
end


UserInputService.InputBegan:Connect(function(input,gpe)
	if gpe then return end
	if input.KeyCode == constants.sprintKey and not shooting then
		Sprint()
	elseif input.KeyCode == constants.crouchKey then
		Crouch()
	elseif input.KeyCode == Enum.KeyCode.Space then
		if crouching then
			Crouch()
		end
	end 
end)


