Label::color: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 31: | Line 31: | ||
}); | }); | ||
</pre> | </pre> | ||
Latest revision as of 07:40, 5 September 2020
Shared
Update the color of the selected label
Syntax
Number label.color
- colorR - Number
- colorG - Number
- colorB - Number
- colorAlpha - Number
Examples
Updates the color of the label through the command /labelcolor
Server-Side
let startLabel = mp.labels.new("Use /labelcolor to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
{
los: false,
font: 1,
drawDistance: 100,
color: [255, 255, 255, 255]
});
mp.events.addCommand("labelcolor", (player, _, colorR, colorG, colorB, colorAlpha) => {
startLabel.color = parseInt(colorR, colorG, colorB, colorAlpha);
player.outputChatBox(`You have updated the color of the label to: ${colorR} ${colorG} ${colorB} ${colorAlpha}`);
});