Hello! Lately, my friend tried to make a game which is a shooter game, but he can’t figure out on how to make a player join a reserved server.
Solutions we tried: Checking on other topics, looking in roblox documentations, looking it up, changing the scripts.
Before you ask: the “Allow Third Party Teleports” option was already enabled before we tested.
This is the code we currently have:
#1 remote
ts = game:GetService("TeleportService")
game.ReplicatedStorage.mm.OnServerEvent:Connect(function(plr)
local rs = ts:ReserveServer(13974718537)
print(rs)
wait(.24)
ts:TeleportToPrivateServer(13974718537, rs, {plr}, "SpawnLocation", {from = "none"})
end)
#2 remote (submitting an invite code)
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr, inv)
local ts = game:GetService("TeleportService")
print(inv)
ts:TeleportToPrivateServer(13974718537, tostring(inv), {plr}, "SpawnLocation", {["TeleportedFrom"] = game.PlaceId}, nil)
end)
In the localscript in that button:
script.Parent.TextButton.MouseButton1Click:Connect(function()
script.Parent.RemoteEvent:FireServer(tonumber(script.Parent.tb.Text))
script.Parent.TextButton.Visible = false
end)