Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Did teleporting break in the new update or am I going crazy?

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()??

4 comments

1

I am not getting any errors, BTW.

1

Use CFrame

0

I will try it, but I doubt that would change the outcome since MoveTo is a Roblox function.

0

And OFC it works, it always works when I think I am right...

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.