hello, i am trying to make a game with a multiplayer tab in it, how could I go about handling the multiplayer tab? here is an example of the multiplayer tab I’m trying to go for
2 Likes
You would message all Servers and make all Servers send their Player count and then show it in the GUI
Okay so, you would need to use Roblox’s teleport service.
game:GetService("TeleportService"):Teleport(serverId)
Then you would get all the servers and add them to a table.
local instances = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync()
local servers = {}
for _, instance in pairs(instances) do
if instance.IsServer then
table.insert(servers, instance)
end
end
Then lastly you would do the UI part of this.
for _, server in pairs(servers) do
local serverButton = Instance.new("TextButton")
serverButton.Name = server.Name
serverButton.Text = server.Name
serverButton.Parent = gui
serverButton.MouseButton1Click:Connect(function()
game:GetService("TeleportService"):Teleport(server.Id)
end)
end
ill try it out and see if it works
Okay! Keep me updated, I’ll be happy to assist you further.
is it supposed to be “serverId” or “placeId” roblox say’s serverid does not exist
You can give placeid a go, ill jump on PC in a few to figure it out.