How could this be rewritten to be more smooth and consistent during a game? Sometimes it works and other times it is really delayed (5-10 seconds)
-- function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
wait(.01) if player then
A major glaring issue I see here is that your script is teleporting a user every time they register .Touched, which could be like 10 times in less than a second, I’m sure TeleportService has something to combat this, but it just doesn’t seem right to me.
As others have mentioned, TeleportService is inconsistent, breaks a lot, and should overall be avoided whenever possible.