For some reason, when pressing the teleport button on a teleport GUI, it won't tp the players in a private server to a place with a private server. There are no errors, why isn't it teleport the players in a private server to an identical place with a private server?
local button = script.Parent local player = game:GetService("Players").LocalPlayer local TeleportService = game:GetService("TeleportService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local PlaceId = 6010776300
function OnActivation()
print("hi")
TeleportService:SetTeleportGui(ReplicatedStorage:FindFirstChild("TeleportGUI"))
local random = math.random(1,4)
local Frame = player.PlayerGui.TeleportGUI.Frame
Frame.Active = true
if random == 1 then
Frame.Clownfish.Visible = true
print("worls")
end
if random == 2 then
Frame.Global.Visible = true
end
if random == 3 then
Frame.ChalkGirl.Visible = true
end
if random == 4 then
Frame.FakeCoaches.Visible = true
end
--//Teleport That Player
if game.PrivateServerId ~= "" then
if game.PrivateServerOwnerId ~= 0 then
local reservedServer = TeleportService:ReserveServer(PlaceId)
print("sup")
TeleportService:TeleportToPrivateServer(PlaceId,reservedServer,{player})
end
else
TeleportService:Teleport(PlaceId,player)
TeleportService:GetLocalPlayerTeleportData()
print("Teleporting")
end
end
button.Activated:Connect(OnActivation)
