I'm making a game and im sending people to a separate place within my game. It's a reserved Server so only the people I send will be able to join. Whenever I test it out in Game(Not studio mode) it always pulls up with "Teleport Failed to an unexpected error.(Error Code:769)" Please Help.
local tpService = game:GetService("TeleportService") local place = (Im not Showing This) script.Parent.Touched:Connect(function(hit) local code = tpService:ReserveServer(game.PlaceId) local player = game.Players:GetChildren() if player then tpService:TeleportToPrivateServer(place,code,player,"StartSpawn",nil,nil) end end)
Seems to work for me, my guess is your 'place' id variable wasn't the same as game.PlaceId
local PlayersService = game:GetService('Players') local TeleportService = game:GetService("TeleportService") local PlaceId = game.PlaceId local ReservedServerCode = TeleportService:ReserveServer(PlaceId) script.Parent.Touched:Connect(function(hit) if hit and hit.Parent then local Player = PlayersService:GetPlayerFromCharacter(hit.Parent) if Player and Player.Character then local Humanoid = Player.Character:FindFirstChild("Humanoid") if Humanoid and Humanoid.Health > 0 then -- Use the GetPlayers() method on Players local Players = PlayersService:GetPlayers() -- Should be > 0 since someone stepped on it if #Players > 0 then TeleportService:TeleportToPrivateServer(PlaceId, ReservedServerCode, Players, "StartSpawn") end end end end end)