Bugbugbug, i got the main test code for the hats and stuff for on your head. ;D
datablock ShapeBaseImageData(PutHatNameHereImage)
{
shapeFile = "./Modelname.dts"; //Put name of the model at Modelname
emap = true; //A boolean value specifying whether to render environmental map or not.
mountPoint = $HeadSlot; //For hats, keep it like this obviously
offset = "0 0 0"; //with this line you can change the position of the hat manually
eyeOffset = "0 0 0"; //with this you can change the players view, so you can ensure they will not keep looking against the hat
rotation = eulerToMatrix("0 0 0"); //rotation
scale = "1 1 1"; //scale
doColorShift = true;
colorShiftColor = "1.000 1.000 1.000 1.000";
};
//Command to equip the hat or whatever, change the command at "PutCommandHere", eventually you have to write in the chat:"/PutCommandHere"
function serverCmdPutCommandHere(%client)
{
%player = %client.player;
if(isObject(%player))
{
if(%player.getMountedImage(2) $= nametoID(PutHatNameHereImage)) //Be sure to change PutHatNameHere
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(PutHatNameHereImage,2); //Once again, watch it
for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}
EDIT:
Will now look for a code to implent headstuff when you are a certain datablock.