Build a lobby with a ready check
A waiting room where players ready up and the host starts the game.
1. Create or join a lobby
# Host:
MultiplayerService.create_lobby("My Lobby", "public", 8, {}, "Alice")
MultiplayerService.lobby_created.connect(func(lobby): print("code: ", lobby.code))
# Others — list public lobbies, then join by code:
MultiplayerService.list_lobbies()
MultiplayerService.join_lobby("ABC123", "Bob")
2. Track the roster
A lobby is a room, so the same join/leave signals apply.
MultiplayerService.player_joined.connect(func(_room, player): add_player(player)) MultiplayerService.player_left.connect(func(_room, player_id): remove_player(player_id))
3. Ready up (via room events)
Broadcast each player's ready state with an event; everyone tracks it.
func toggle_ready(is_ready: bool) -> void:
MultiplayerService.send_event("ready", { "ready": is_ready })
MultiplayerService.event_received.connect(func(ev, data, from):
if ev == "ready": ready_by_id[from] = data.ready)
When a new player joins, re-announce your ready state so they're caught up.
4. Host starts the game
# Only the host shows this; enable when everyone is ready:
MultiplayerService.send_event("start", {})
MultiplayerService.event_received.connect(func(ev, _d, _f):
if ev == "start": start_game())
Full version: the Lobby + Ready Check example in
sdk/godot-gdscript/examples/lobby_ready/.