Skip to main content

Label::color

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}`);
});