Can someone Help me with it ?
local UserInputService = game.GetService("UserInputService")
local Plr = game.Players.LocalPlayer
local Char = Plr.Character
local Hum = Char.WaitForChild("Humaniod")
local SprintAnim= Hum.Animator:LoadAnimation(script.Run)
local Keybind = Enum.KeyCode.LeftShift
local SprintSpeed = 15
local Sprinting = false
local function StopSprint()
if Sprinting then
Sprinting = true
Hum.WalkSpeed -= SprintSpeed
SprintAnim:Stop(0.25)
end
end
local function StartSprint()
if not StartSprint then
Sprinting = true
Hum.WalkSpeed += SprintSpeed
SprintAnim:Play(0.25)
end
end
UserInputService.InputBegan:Connect(function(Input,IsTyping)
if IsTyping then return end
if Input.KeyCode == Keybind then
if not Sprinting then
StartSprint()
end
end
end)
UserInputService.InputEnded:Connect(function(Input,IsTyping)
if Input.KeyCode == Keybind then
if Sprinting then
StopSprint()
end
end
end)
** You are now Level 2! **