TPG.Util.ChatMessageThrottled(ply, key, message, color, interval)📋 Has LDoc👁️ 0 viewsUpdated 1 month ago
Description
Send a chat line, at most once every interval seconds per player. For messages driven by an event the player can fire dozens of times in a tick: a spawn-menu click held down, a paste of thirty props refused one prop at a time. Without this the refusal is technically correct and completely unreadable, and the useful line above it is gone from the chat box. key is what gets rate limited, not the text, so a message whose body carries a changing count still collapses to one line per interval. Different keys never suppress each other, so an unrelated warning arriving in the same second still gets through.
Parameters
| Name | Type | Description |
|---|---|---|
ply | Player | Recipient. |
key | string | Groups messages that should suppress one another. |
message | string | Text to send. |
color? | Color | Colour to print it in.(default: white) |
interval? | number | Seconds of silence after a send.(default: 2) |
Returns
| Type | Description |
|---|---|
boolean | Whether the line was actually sent. |
Examples
No examples available.
Used In
No usages found in the codebase.