Forja

Roblox sprint script

Players hold Left Shift to run faster, and phone players get a button for it.

Where it goes

  1. 1In the Explorer, open StarterPlayer, hover over StarterCharacterScripts, press + and choose LocalScript.
  2. 2Delete what's in it, paste this in and press Play.
  3. 3Hold Left Shift to run. Try a phone in Studio's Device view to see the button.
Sprint · a LocalScript in StarterPlayer > StarterCharacterScripts
-- From forja.us/tools/roblox-scripts/sprint-- Hold Left Shift, or the button on a phone, to run.local ContextActionService = game:GetService("ContextActionService")local WALK_SPEED = 16local SPRINT_SPEED = 28local character = script.Parentlocal humanoid = character:WaitForChild("Humanoid")local function onSprint(_, inputState)	if inputState == Enum.UserInputState.Begin then		humanoid.WalkSpeed = SPRINT_SPEED	else		humanoid.WalkSpeed = WALK_SPEED	end	return Enum.ContextActionResult.PassendContextActionService:BindAction("Sprint", onSprint, true, Enum.KeyCode.LeftShift)ContextActionService:SetTitle("Sprint", "Run")

How it works

  • It's a LocalScript in the character, so it runs on the player's own device and starts again each time they respawn.
  • BindAction listens for the key, and its true asks Roblox to make the button on touch screens.
  • WalkSpeed is how fast the character moves: 16 is Roblox's normal speed.

Make it yours

Faster or slower
Change SPRINT_SPEED. Past about 40, players are hard to control.
Another key
Replace Enum.KeyCode.LeftShift, for example with Enum.KeyCode.Q.
Want something more? The script generator can write it: “A sprint with a stamina bar that drains while running and refills when walking”

Maps to try it on: horror maps

Start from a finished map, and your scripts have a game to run in.

More free Roblox scripts