Velinquish

Simplified

Apr 16th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. --[[
  2.     A much simplified version. The only problem with this is that wait(INTERVAL) is a blindspot.
  3.     If the player stops during this time, and resumes really quickly,the speed won't reset.
  4. --]]
  5.  
  6. local player = game.Players.LocalPlayer
  7. local hum = player.Character:WaitForChild("Humanoid")
  8.  
  9. local WALK_SPEED = 16 -- Beginning walk speed
  10. local INCREASE = 0.5 -- How much it accelerates each time
  11. local INTERVAL = 0.1
  12.  
  13. while true do
  14.     while hum.MoveDirection ~= Vector3.new() do -- While the humanoid hasn't stopped
  15.         hum.WalkSpeed = hum.WalkSpeed + INCREASE
  16.         wait(INTERVAL)
  17.     end
  18.     hum.WalkSpeed = WALK_SPEED
  19.     -- Wait for player to start running agains
  20.     hum.Running:Wait() -- or wait for hum.MoveDirection to change with hum:GetPropertyChangedSignal()
  21. end
Add Comment
Please, Sign In to add comment