Skip to content

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.

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

boolean - false when either is not connected, or they are one player

-- 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") end

GetPlayerPromptFor · SetPlayerPrompt · OnPlayerInteractPlayer · the Players group of the index