tw.input
Side: Client
Native RedM onscreen keyboard input. Blocking call that yields the current thread.
Functions
tw.input.native(label, placeholder, maxStringLength?)
Opens the native onscreen keyboard and waits for the player to submit or cancel.
| Parameter | Type | Default | Description |
|---|---|---|---|
label | string | — | Title displayed above the keyboard |
placeholder | string | — | Placeholder text in the input field |
maxStringLength | integer? | 60 | Maximum number of characters |
Returns: string — The text entered by the player, or "" (empty string) if the player pressed Escape.
Examples
Basic text input
lua
local name = tw.input.native("Rename", "Enter a new name")
if name ~= "" then
print("Player entered: " .. name)
else
print("Player cancelled input")
endLimited input length
lua
local code = tw.input.native("Door Code", "Enter 4-digit code", 4)
if code ~= "" then
TriggerServerEvent("doorlock:tryCode", code)
endNotes
- This function is blocking (yields the thread). It will not return until the player submits or cancels.
- Returns an empty string
""when the player presses Escape. - The native keyboard is the standard RedM/GTA input overlay.

