iOSdeveloper

Untitled

Jan 2nd, 2025
161,811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function isNumber(str)
  2. if tonumber(str) ~= nil or str == 'inf' then
  3. return true
  4. end
  5. end
  6. local tspeed = 1
  7. local hb = game:GetService("RunService").Heartbeat
  8. local tpwalking = true
  9. local player = game:GetService("Players")
  10. local lplr = player.LocalPlayer
  11. local chr = lplr.Character
  12. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  13. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  14. if hum.MoveDirection.Magnitude > 0 then
  15. if tspeed and isNumber(tspeed) then
  16. chr:TranslateBy(hum.MoveDirection * tonumber(tspeed))
  17. else
  18. chr:TranslateBy(hum.MoveDirection)
  19. end
  20. end
  21. end
Add Comment
Please, Sign In to add comment