Advertisement
Velinquish

Bonus Solution

Apr 16th, 2020
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local hum = player.Character:WaitForChild("Humanoid")
  3.  
  4. local WALK_SPEED = 16
  5. local INCREASE = 0.1 -- Constant increase in acceleration
  6. local INTERVAL = 0.1
  7. local acceleration = 0 -- Acceleration is now a variable, changebale, not a constant
  8.  
  9. while true do
  10.     while hum.MoveDirection ~= Vector3.new() do
  11.         acceleration = acceleration + 0.1 -- Increasing the acceleration
  12.         hum.WalkSpeed = math.min(hum.WalkSpeed + acceleration, 250) -- Limits it to 250
  13.         wait(INTERVAL)
  14.     end
  15.     hum.WalkSpeed = WALK_SPEED
  16.     hum.Running:Wait()
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement