Console
Functions for creating and interacting with an external console window.
TIP
All console functions have two naming conventions: rconsole* and console* (e.g., rconsoleprint and consoleprint). Both work identically.
rconsolecreate
Creates a new console window and optionally sets its title. If a console already exists, it updates the title.
Aliases: rconsolename, rconsolesettitle, consolecreate, consolename, consolesettitle
rconsolecreate(title: string?) -> void| Parameter | Type | Default | Description |
|---|---|---|---|
title | string? | "Console" | The console window title |
Example
rconsolecreate("My Script Console")rconsoleprint
Writes text to the console window. Supports color formatting using @@COLOR@@ tags.
Aliases: consoleprint
rconsoleprint(text: string) -> void| Parameter | Type | Description |
|---|---|---|
text | string | The text to print (supports color tags) |
Color Tags
Wrap text with color tags to change the output color:
| Tag | Color |
|---|---|
@@BLACK@@ | Black |
@@BLUE@@ | Blue |
@@GREEN@@ | Green |
@@CYAN@@ | Cyan |
@@RED@@ | Red |
@@MAGENTA@@ | Magenta |
@@BROWN@@ | Brown |
@@LIGHT_GRAY@@ | Light Gray |
@@DARK_GRAY@@ | Dark Gray |
@@LIGHT_BLUE@@ | Light Blue |
@@LIGHT_GREEN@@ | Light Green |
@@LIGHT_CYAN@@ | Light Cyan |
@@LIGHT_RED@@ | Light Red |
@@LIGHT_MAGENTA@@ | Light Magenta |
@@YELLOW@@ | Yellow |
@@WHITE@@ | White |
Example
rconsolecreate("Output")
rconsoleprint("Hello, World!\n")
rconsoleprint("@@RED@@This is red text@@WHITE@@\n")
rconsoleprint("@@GREEN@@Success! @@YELLOW@@Warning! @@RED@@Error!\n")rconsoleinfo
Writes an informational message to the console (typically displayed in a distinct style).
Aliases: consoleinfo
rconsoleinfo(text: string) -> voidExample
rconsoleinfo("Script loaded successfully")rconsolewarn
Writes a warning message to the console.
Aliases: consolewarn
rconsolewarn(text: string) -> voidExample
rconsolewarn("Low health detected!")rconsoleerr
Writes an error message to the console.
Aliases: consoleerr
rconsoleerr(text: string) -> voidExample
rconsoleerr("Failed to load module!")rconsoleclear
Clears all text from the console window.
Aliases: consoleclear
rconsoleclear() -> voidExample
rconsoleprint("This will be cleared\n")
task.wait(2)
rconsoleclear()rconsoleinput
Waits for the user to type input into the console and press Enter. Returns the input string.
Aliases: rconsoleinputasync, consoleinput, consoleinputasync
rconsoleinput() -> stringWARNING
This function yields until the user provides input.
Example
rconsolecreate("Input Demo")
rconsoleprint("Enter your name: ")
local name = rconsoleinput()
rconsoleprint("Hello, " .. name .. "!\n")rconsoledestroy
Destroys the console window.
Aliases: consoledestroy
rconsoledestroy() -> voidExample
rconsolecreate("Temporary Console")
rconsoleprint("Closing in 3 seconds...\n")
task.wait(3)
rconsoledestroy()