RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a shift to sprint that when you hold shift you run but when you un hold it you stop running"
-- local script local shiftDown = false local function onKeyDown(key) if key == "Shift" then shiftDown = true end end local function onKeyUp(key) if key == "Shift" then shiftDown = false end end game.Players.LocalPlayer.InputBegan:Connect(onKeyDown) game.Players.LocalPlayer.InputEnded:Connect(onKeyUp) while true do if shiftDown then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 else game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 8 end wait() end