SetPlayerChatBubble
A line over a player’s head, in a color of your own, for everyone near them.
The same speech bubble a chat line shows over the speaker ([ui] chat_bubbles), but the mode’s: the text, the color
(0xRRGGBBAA), how far it is seen (distance metres, 20 by default) and how long it stays (ms; 0 or nil = by
the line’s length, 5 to 12 s). The speaker sees nothing - nobody sees their own head - so a role-play mode prints the
line in their chat as well. One line at a time per player; a new one replaces the old.
Syntax
Section titled “Syntax”SetPlayerChatBubble(pid, text [, color, distance, ms])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
text |
string | the line (one line; long ones are cut) |
color |
number | 0xRRGGBBAA (COLOR_WHITE) (optional) |
distance |
number | metres (20) (optional) |
ms |
number | milliseconds (0 = by the length) (optional) |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”-- /ame nods slowly: "* Henry nods slowly" over the head in the role-play lavender, and in the speaker's chatif cmd == "ame" then local line = "* " .. GetPlayerName(pid) .. " " .. args SetPlayerChatBubble(pid, line, COLOR_PURPLE, 20) SendClientMessage(pid, COLOR_PURPLE, line) return trueendSee also
Section titled “See also”SendClientMessage · GetPlayersInRange · SetPlayerNameplate · the Chat and commands group of the index
