print("Teleporting players...")
game:GetService('TeleportService'):Teleport(arenaPlaceId, playerA)
print(playerA.Name .. " teleported")
game:GetService('TeleportService'):Teleport(arenaPlaceId, playerB)
print(playerB.Name .. " teleported")

Here I have this wonderful code. Both playerA and playerB are valid player instances. However, when this code runs, the debug output is printed, but neither player is teleported. Why not? (This is in a server script)

Edit: The players are defined here. I know this works because both playerA.Name and playerB.Name work as they should.

local playerA = nil
	local playerB = nil
	for _, player in pairs(game.Players:GetPlayers()) do
		if player.userId == playerAId then
			playerA = player
		end
		if player.userId == playerBId then
			playerB = player
		end
	end

2 comments

0

You say "playerA" and "playerB" are both valid player instances. So that leads me to assume this is not the full code. Please post the full code in order to get help.

0

Edited with the declaration code