So currently I’m trying to create a system where players can view the server list of children places to the actual game.
And so I’ve been doing that for like the past hour and a half and I just can’t figure it out.
Don’t even ask what I got rn because it’s all garbage, if you really wanna know what is working, I got a simple server invoke to get the server list data…
The most convenient way to do this would be to host an external server and contact an endpoint that would collect the active servers and return them to you. Most hosting services are paid, though. You could try to find a proxy service that is either dedicated to contacting Roblox endpoints or simply can. This way you could implement the procedure on the server in your game. Alternatively, you can use MessagingService to prompt all servers to upload their job IDs to a memory store. You’ll have to keep querying the memory-store to make sure all job IDs are being displayed, as there’s no way to know how many servers are active, and not all servers will report themselves in time. You could also just set a timeout and display what was received in that time frame.
Hm alright. How would most games go about it though if you perhaps know? Like I’ve seen some pretty cool zombie games that displays the servers with their ping, player count, job ID, etc.
Also, would it be possible to let the player be able to create a server in that place?
Edit: what I mean by create a server is like a create server button yknow
As said above, the best method to do this would be with proxies. MessagingService can work, but you would have to devise methods to update the server list every time you show it (like when a server closes, for example).
On the other side, you have proxies, which unfortunately need to be hosted by you, as those done by third parties blocked the endpoint or stopped working.
To create servers, Roblox already has this method included in the API:
-- Example with clicking a button
local TeleportService = game:GetService("TeleportService")
local debounce = false
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if debounce == false then
debounce = true
local code = TeleportService:ReserveServer(game.PlaceId)
TeleportService:TeleportToPrivateServer(game.PlaceId, code, {plr})
task.wait(1.5)
debounce = false
end
end)