Not teleporting players

Hello, so im trying to teleport all the players with this script but it isnt doing anything

1 Like

Set the value after you connect to the .Changed event.

This won’t do anything and is just a shot in the dark.

The line with your for loop, you should change to:

for _, player in pairs(game.Players:GetPlayers()) do

This should most likely resolve your issue.

1 Like

“:GetChildren()” will return an array of the “PlayersService” children, which is typically the same as calling “:GetPlayers()” unless something has been parented to the “PlayersService” which isn’t a player instance. Nevertheless, I agree that “:GetPlayers()” should be used as it’s more intuitive.

Try adding print commands to see where the script isn’t functioning as intended, additionally, use the new pivot methods to move models, i.e;

character:PivotTo(workspace.Part.CFrame)

I was mostly focusing on the use of pairs rather than ipairs

Oh, well ipairs() would be fine since an array is being iterated over not a dictionary.