How can I rejoin a player in a game with 0 players?

I’m working on a game right now that saves player data, and I’ve added a button to reset their data that’s supposed to rejoin them as well.
My problem is that my game has 0 players, so when I try to rejoin myself using TeleportService:Teleport() or TeleportService:TeleportAsync(), it sends me to the same server–which is now shutting down. It also gives me an error message that says “This place has shut down”

I’d prefer not to use ReserveServer since that could take longer on slower connections like mine lol. these are the two methods I’ve tried so far ^^

first attempt -

local teleportOpt;
if #players:GetPlayers() > 1 then
	teleportOpt = Instance.new("TeleportOptions")
	teleportOpt.ServerInstanceId = game.JobId
end
game:GetService("TeleportService"):TeleportAsync(game.PlaceId, {plr}, teleportOpt)

second attempt -

if #players:GetPlayers() > 1 then
	game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, plr)
else
	game:GetService("TeleportService"):Teleport(game.PlaceId, plr)
end
1 Like

I don’t think there could be a way to do this. You could maybe utilise both? If the game has 0 players then just make a reserved server, else teleport to the same server.

i definitely could and that’s my fallback plan if there isn’t another way, but i’m just hoping to see if i can make the rejoining process cleaner