Hosted Luau scripts interact with the running server through a narrow bridge instead of a full Node
runtime. The bridge is versioned under Bridge.meta.version.
Inbound events
Bridge.on("playerJoin", function(player)
print("joined", player.username)
end)
Bridge.on("playerLeave", function(player)
print("left", player.username)
end)
Bridge.on("initialSpawn", function(player)
print("spawned", player.username)
end)
Bridge.on("chat", function(player, message)
print(player.username, message)
end)
Bridge.on("brickClick", function(player, brick, secure)
print("clicked", brick.name, secure)
end)
Bridge.on("heartbeat", function(dt, timestamp)
-- runs on the hosted heartbeat loop
end)
Outbound methods
| Method |
Description |
Bridge.messageAll(message) | Broadcast a message to every connected player. |
Bridge.messagePlayer(userId, message) | Send a message to one player. |
Bridge.setPlayerProperty(userId, property, value) | Change supported player state like health, speed, position, scale, score, team, and speech. |
Bridge.createBrick(descriptor) | Create a runtime brick. |
Bridge.updateBrick(brickId, changes) | Update a runtime brick. |
Bridge.removeBrick(brickId) | Delete a runtime brick. |
Bridge.createTeam(descriptor) | Create a team at runtime. |