SetPlayerPromptFor
The use prompt one viewer alone sees over a player.
viewer sees text over pid instead of everyone’s prompt; "" shows them none, nil gives them everyone’s again.
OnPlayerInteractPlayer fires for the viewer’s use key while their prompt shows. Gone when either player leaves.
hidden works as in SetPlayerPrompt: the viewer’s use key is armed with nothing drawn over the player’s head.
Syntax
Section titled “Syntax”SetPlayerPromptFor(viewer, pid, text, hidden)| Parameter | Type | |
|---|---|---|
viewer |
number | the player who sees the prompt |
pid |
number | the player it hangs over |
text |
string | nil | the word; "" = none for them; nil = everyone’s again |
hidden |
boolean | nil | true = no [E] text line over the head for this viewer, the use key still works |
Returns
Section titled “Returns”boolean - false when either is not connected, or they are one player
Example
Section titled “Example”-- a guard on duty sees "Arrest" over a wanted player; everyone else still sees "Talk"for _, guard in ipairs(guardsOnDuty) do SetPlayerPromptFor(guard, wanted, "Arrest") endSee also
Section titled “See also”GetPlayerPromptFor · SetPlayerPrompt · OnPlayerInteractPlayer · the Players group of the index
