What I’m trying to do is send the LocalPlayer to a Private Server through clicking a PlayerGUI button. I have a LocalScript inside the button.
local ts = game:GetService("TeleportService")
local event = game.ReplicatedStorage.PrivateServer
local place = 16318595535
script.Parent.Activated:Connect(function()
event:FireServer(place)
end)
As you can see, I have an event in ReplicatedStorage.
I also have a script inside of ServerScriptService that listens for ServerEvents from the event in Replicated Storage.
local ts = game:GetService("TeleportService")
local event = game.ReplicatedStorage.PrivateServer
event.OnServerEvent:Connect(function(plr, place)
local code = ts:ReserveServer(place)
ts:TeleportToPrivateServer(place, code, plr)
end)
It’s not working though. I’ve tried to use just a localscript to teleport the player, but you cannot reserve servers from the client.
Thanks for any help.