Skip to content

SetActorPrompt

The prompt under an actor’s name within reach - the use key on it reaches the mode.

A short text (“Talk”, “Trade”, “Challenge”, “Ask about the road”) shown as [E] Talk under the name to a player within 3.5 m, and in the game’s own use hint while they look at the body; the use key then fires OnPlayerInteractActor. The text is shown as written, up to 32 characters; one that starts with @ is a text key of the game’s own ("@ui_hud_talk"), shown in the player’s language. nil or "" takes it off (the use key does nothing on the actor). An actor with a shop gets “Trade” by itself; a prompt set after that replaces the word, the shop still opens.

SetActorPrompt(id, prompt)
Parameter Type
id number the actor
prompt string | nil the word; nil = none

boolean - false for anything but an actor

local guard = CreateActor("test_cuman_ai", x, y, z, 180, "Gate guard")
SetActorPrompt(guard, "Talk")

GetActorPrompt · OnPlayerInteractActor · SetActorShop · the NPC actors group of the index