Broadcast
This function can be used to send a packet of information to all users in all joined lobbies.
Syntax
- boolean P2P:Broadcast(number messageid, BankStream data, number channel = 0, number flags = 0)
- boolean P2P:Broadcast(number messageid, Bank data, number channel = 0, number flags = 0)
- boolean P2P:Broadcast(number messageid, number channel = 0, number flags = 0)
- boolean P2P:Broadcast(number messageid, string data, number channel = 0, number flags = 0)
Parameters
- messageid: an ID for the message.
- data: an optional bit of data you can include in the message.
- channel: the channel the message will be received on.
- flags: by default packets are unreliable. This can be set to Reliable for important messages you don't want to lose, but by default this should be zero.
Returns
Returns true if the message was sent successfully.