More reason for the existence of recolorable bot hats. Having arbitrarily chosen colors that add several datablocks is dumb
Could be done with a playertype, but it's a bit silly, works tho!
I've done this before:
function NeedsMember::colorPlumbob(%this)
{
if(isObject(%this.player.getControllingClient().plumbob))
{
%needsSum = %this.hunger+%this.thirst+%this.energy+%this.fun+%this.hygiene+%this.toilet;
%r = 1-(%needsSum/60)*1.5;
if(%r>1)
%r = 1;
%g = %needsSum/60;
%color = %r SPC %g SPC "0.2 1";
%this.player.getControllingClient().plumbob.setNodeColor("plumbob",%color);
}
}
datablock PlayerData(PlumbobObject)
{
emap = true;
class = Armor;
shapeFile = "./plumbob.dts";
cameraVerticalOffset = 1.5;
};