How would you get a random hex number?
You should use getRandom(%this,%that);
%client.textColor = getRandom(000000, FFFFFF);messageClient(%client,'',"the color is " @ %client.textColor);
D: This doesn't workCode: [Select]%client.textColor = getRandom(000000, FFFFFF);messageClient(%client,'',"the color is " @ %client.textColor);This says "the color is 0" every time?
function randomHex(){ for(%i=0; %i<6;%i++) { %rand = getRandom(0,15); switch(%rand) { case 10: %dig="A"; case 11: %dig="B"; case 12: %dig="C"; case 13: %dig="D"; case 14: %dig="E"; case 15: %dig="F"; default: %dig=%rand; } %hex=%hex@%dig; } return(%hex);}
I dont think you can get random hex value that way.Code: [Select]function randomHex(){ for(%i=0; %i<6;%i++) { %rand = getRandom(0,15); switch(%rand) { case 10: %dig="A"; case 11: %dig="B"; case 12: %dig="C"; case 13: %dig="D"; case 14: %dig="E"; case 15: %dig="F"; default: %dig=%rand; } %hex=%hex@%dig; } return(%hex);}You can call this fucntion I whipped up. Put it into your code. This would get a random number 0-15 (amount of choices a single hex digit could be) and if its 10-15 turns it into a letter.It then combines it all into a single hex variable. Then it returns it.
Broken code. Recheck it.%rand = getrandom...switch(%blah)default: %dig=%blah;
A friend said that %a is the client
Actually no, a friend said that %a was the index of that player on the NPL_List (playerlist).