Advertisement
Velinquish

Getting rid of the blindspot

Apr 16th, 2020
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. --[[
  2.     This gets rid of the 0.1 second blindspot.
  3. --]]
  4.  
  5. local player = game.Players.LocalPlayer
  6. local hum = player.Character:WaitForChild("Humanoid")
  7.  
  8. local WALK_SPEED = 16 -- Beginning walk speed
  9. local INCREASE = 0.5 -- How much it accelerates each time
  10. local INTERVAL = 0.1
  11.  
  12. while true do
  13.     local isRunning = hum.MoveDirection ~= Vector3.new()
  14.     spawn(function() -- One loop detects when the player stops, getting rid of the blind spot
  15.         repeat
  16.             isRunning = hum.Running:Wait() ~= 0
  17.         until not isRunning
  18.     end)
  19.     while isRunning do -- The other loop will incrememnt the WalkSpeed
  20.         hum.WalkSpeed = hum.WalkSpeed + INCREASE
  21.         wait(INTERVAL)
  22.     end
  23.     hum.WalkSpeed = WALK_SPEED
  24.     -- Wait for player to start running agains
  25.     hum.Running:Wait() -- or wait for hum.MoveDirection to change with hum:GetPropertyChangedSignal()
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement