Studios
Map Handlerhouse-3.jpg

Commands & Exports

SoonMap HandlerStandalone
PAGE 06 OF 06  ·  TROUBLESHOOTING → COMMANDS & EXPORTSdocs.glitchstudios.dev
Browse docs

Commands#

None. The resource registers no commands.

Server exports#

Export Returns
SetBucketWorld(bucket, worldId) true, or false for bucket 0 or an unknown or disabled world. A nil world clears the bucket.
ClearBucketWorld(bucket) true
GetBucketWorld(bucket) World id or nil
Sync(src) Pushes the player's world now. Call it right after SetPlayerRoutingBucket.
SetPlayerWorld(src, worldId) true or false. This player sees the world wherever they are. nil goes back to the bucket's world.
GetWorld(worldId) { id, label, spawn, racing, vrOnly } or nil
ListWorlds() The enabled worlds, sorted by label

A world set by a resource is cleared when that resource stops.

Client exports#

Export Returns
GetWorld() The id of the loaded world, or nil
ListWorlds() The same list as the server export

Events#

Event Side When
glitch-mapHandler:client:changed(worldId) Client, local After the player's world changes. worldId is nil for the city.
glitch-mapHandler:server:ready Server, local The resource started. Register your bucket worlds again here.
glitch-mapHandler:server:bucketCleared(bucket, worldId, reason) Server, local A bucket world was cleared. reason is cleared, empty, unused or owner stopped.

State bag#

Player(src).state.mapWorld holds the world a player is shown, or nil for the city.