Label::text

From RAGE Multiplayer Wiki
Revision as of 07:24, 31 May 2018 by MrPancakers (talk | contribs) (Created page with "{{Shared}} Updates the text of a created label. == Syntax == <syntaxhighlight lang="javascript"> label.text = "Text"; </syntaxhighlight> == Examples == Updates the text of...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Shared

Updates the text of a created label.

Syntax

label.text = "Text";

Examples

Updates the text of a label through a command.

let startLabel = mp.labels.new("Use /labeltext to update me.", new mp.Vector3(-431.88, 1146.86, 327),
    {
        los: false,
        font: 1,
        drawDistance: 100,
    });

mp.events.addCommand("labeltext", (player, _, text) => {
    startLabel.text = text;
    player.outputChatBox("Label Updated");
});

See Also