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 R=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local l=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local a=require(R.ClientModules.Constants)local M=game.Players.LocalPlayer local U=M.Character or M.CharacterAdded:Wait()local E=U:WaitForChild("\072\117\109\097\110\111\105\100")local O=E:WaitForChild("\065\110\105\109\097\116\111\114")local x,p=nil,nil local C,N=nil,nil IdleAnimation=O:LoadAnimation(R.Animations.Idle)SprintAnimation=O:LoadAnimation(R.Animations.Sprint)CrouchAnimation=O:LoadAnimation(R.Animations.Crouch)local G=false local y=false local g=false local B=false local function j()if y then E.WalkSpeed=16 SprintAnimation:Stop()y=false end if G then E.WalkSpeed=16 CrouchAnimation:Stop()else if g then IdleAnimation:Play()end CrouchAnimation:Play()E.WalkSpeed=10 end G=not G end local function H()if G then E.WalkSpeed=16 CrouchAnimation:Stop()if g then IdleAnimation:Stop()end G=false end if y then E.WalkSpeed=16 if g then SprintAnimation:Stop()IdleAnimation:Play()end else if g then IdleAnimation:Stop()SprintAnimation:Play()end E.WalkSpeed=24 end y=not y end l.InputBegan:Connect(function(R,l)if l then return end if R.KeyCode==a.sprintKey and not B then H()elseif R.KeyCode==a.crouchKey then j()elseif R.KeyCode==Enum.KeyCode.Space then if G then j()end end end)
-- deltarager cried here
-- 27/05/2021

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)
