I have this loop here that teleports players in this game I have called Binary Bash. I have been using this SAME LOOP for the whole game, and it was working fine. After I updated my studio TODAY, the whole thing breaks....
This is the teleport loop: - I tested this with a player, that has watch set to false
for _, player in pairs (PlayersInGame) do if game.Workspace:FindFirstChild(player.Name) then if not player.Settings.Watch.Value then player:WaitForChild("Character"):MoveTo(map.SpawnPlat.Position) end end end
Can someone explain why this won't work, or did Roblox decide to remove :MoveTo()??
The main problem with this code is :WaitForChild("Character")
.
The Character is not a child of the player (it's parent is the workspace
, afterall) -- it is a property. Thus :WaitForChild
will just keep waiting forever.
In a related note, don't look in the workspace for something with the same name. Just look at the player.Character
property.
for _, player in pairs( PlayersInGame ) do if player.Character then if not player.Settings.Watch.Value then player.Character:MoveTo( map.SpawnPlat.Position ) end end end