Author Topic: How to Change a Clients Name & Name Color?  (Read 1464 times)

How Would I do that?

(Thanks in Advance)

Since Blockland v9, you cannot change a client's server name once it has been created. (The one shown in chat etc.)

If you mean, change the name above their head (on the player), then that is possible. Is that what you want?

I'm trying to make a Status Addon where people can put themselves as AFK so their name turns red and has [AFK] added at the end of the name above their head

Is this possible?

To set:
Code: [Select]
%client.player.setShapeName(%client.name SPC "[AFK]");
%client.player.setShapeNameColor("1 0 0 1");

To reset it you'll need to check if they are in a minigame and do stuff with %minigame.colorIdx to get the correct colour, but that might break different mods that change name colour.

So, Can you make an If Function to check if a User is in a Minigamefor me please?  :panda:

Code: [Select]
if(isObject(%client.minigame))

Thank You!

Cookies for you!!  :cookie: :cookie: :cookie: :cookie: :cookie:

just 1 more thing...

How can I put the color of the Name back to the Default Color?

To reset it you'll need to check if they are in a minigame and do stuff with %minigame.colorIdx to get the correct colour, but that might break different mods that change name colour.

I can't remember right now which variables store the minigame colours, so I can't help right now. The default non-minigame colour is white, "1 1 1 1".

I meant outside a Minigame


Thanks Space Guy! You Are the Man!  :cookie:

Just to say,

I have released my Status Mod its now in Addons!

Thanks Space Guy!  :cookieMonster:

Is there a code to make something work if you ARE in a minigame?

Code: [Select]
if(isObject(%client.minigame))

This checks if you are in a minigame.

Code: [Select]
if(!isObject(%client.minigame))
This checks if you are not in a minigame.

Code: [Select]
if(isObject(%client.minigame))
{
 //You're in a minigame
}
else
{
 //You aren't in a minigame
}

This checks both at once, so you can have something only work if you are in a minigame and show an error message if you are not. (The Status mod uses something similar to this)