const
ChatPrint messages to player chat (SayText2), with a caller-owned Chat.color prefix.
import { Chat } from "@s2script/sdk/chat";
Chat.toAll("[Vote] Result: " + winner);
Chat.toSlot(slot, "Usage:color: stringChat.color = ChatColors.Green from @s2script/cs2. "" = no prefix.
A message may also embed its own colors mid-string.
You do NOT need a leading space for color to render: every chat line is auto-prefixed with an invisible
zero-width space (U+200B) so a Source 2 chat box doesn't swallow the message's first color byte. Just
write Chat.toSlot(slot, ChatColors.Green + "hi") — the green lands. (Idempotent: a line you already
lead with a space or a ZWSP is passed through unchanged.)toSlot(slot: number, message: string): voidslot (0-based).toAll(message: string): void