Label::text: Difference between revisions
MrPancakers (talk | contribs) (Updated example to specify it's for serverside) |
m (Replaced HTML with template) |
||
| Line 5: | Line 5: | ||
== Syntax == | == Syntax == | ||
< | <pre> | ||
label.text | String label.text | ||
</ | </pre> | ||
== Examples == | == Examples == | ||
Updates the text of a label through a command. | Updates the text of a label through a command. | ||
{{ServersideCode| | |||
<pre> | |||
< | |||
let startLabel = mp.labels.new("Use /labeltext to update me.", new mp.Vector3(-431.88, 1146.86, 327), | let startLabel = mp.labels.new("Use /labeltext to update me.", new mp.Vector3(-431.88, 1146.86, 327), | ||
{ | { | ||
| Line 26: | Line 25: | ||
player.outputChatBox("Label Updated"); | player.outputChatBox("Label Updated"); | ||
}); | }); | ||
</ | </pre> | ||
}} | |||
== See Also == | == See Also == | ||
{{Label_definition}} | {{Label_definition}} | ||
Latest revision as of 12:30, 26 October 2018
Shared
Updates the text of a created label.
Syntax
String label.text
Examples
Updates the text of a label through a command.
Server-Side
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");
});