So I’m trying to make a teleport script and send the player’s health so they have it in the new place.
I wrote this ServerScript:
local teleportService = game:GetService('TeleportService')
local code = teleportService:ReserveServer(5844872161)
game.ReplicatedStorage.TeleportTime:FireAllClients()
for _, player in pairs(game.Players:GetPlayers()) do
coroutine.resume(coroutine.create(function()
local teleportData = {
health = player.Character.Humanoid.Health,
backpack = player.Backpack:GetChildren()
}
teleportService:TeleportToPrivateServer(5844872161,code,{player},teleportData)
end))
end
It doesn’t work. Nothing happens. The gui fades in, but doesn’t teleport! Thanks for any help, there are no errors!