OnFireRobloxScriptin

Speed Pad Script

May 16th, 2026
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. --//Variables
  2. local speedPad = script.Parent --Variable for Speed Pad
  3. local debounce = {} --Tracks players that have touched the Speed Pad
  4.  
  5. local BOOST_SPEED = 32 --Boosted Speed
  6. local NORMAL_SPEED = 16 --16 is the default speed of Roblox games
  7. local BOOST_TIME = 3 --Duration in seconds of the Speed Boost
  8.  
  9. --//Function
  10. speedPad.Touched:Connect(function(hit) --When the speed pad is touched
  11.     local character = hit.Parent --Variable for the character
  12.     local humanoid = character and character:FindFirstChild("Humanoid") --Variable for the humanoid
  13.  
  14.     if humanoid and not debounce[character] then --If Player is not tracked yet
  15.         debounce[character] = true --Start tracking the player
  16.  
  17.         humanoid.WalkSpeed = BOOST_SPEED --Boost Player's Speed
  18.  
  19.         task.wait(BOOST_TIME) --Wait boost duration
  20.         humanoid.WalkSpeed = NORMAL_SPEED --Set Player's Speed back to normal
  21.  
  22.         debounce[character] = nil --Untrack the player
  23.     end
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment