How to create a shift to sprint system in roblox studio!

Опубликовано: 07 Май 2026
на канале: Gameboy
1,157
25

Hey there please like and subscribe if this video helped you!

Script:

local UserInputService = game:GetService("UserInputService")
local keybind = Enum.KeyCode.LeftShift

local defaultSpeed = 16
local runningSpeed = 25

local character = script.Parent
local humanoid = character.Humanoid

UserInputService.InputBegan:Connect(function(input,processedEvent)
if processedEvent then return end

if input.KeyCode == keybind then
humanoid.WalkSpeed = runningSpeed
end
end)

UserInputService.InputEnded:Connect(function(input,processedEvent)
if processedEvent then return end

if input.KeyCode == keybind then
humanoid.WalkSpeed = defaultSpeed
end
end)