Author Topic: Above Head Script  (Read 1130 times)

Here i have a hat script for my up-coming mod but its not appearing above my head it keeps appearing in my chest :/


Heres script can someone point out problem?


Code: [Select]
datablock ShapeBaseImageData(CrystalImage)
{
shapeFile = "./Crystal.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "0.1 5 5";
doColorShift = false;
colorShiftColor = "50.000 50.000 50.000 255.000";
};

function serverCmdCrystal(%client)
{
%player = %client.player;

if(isObject(%player))
{
if(%player.getMountedImage(2) $= nametoID(CrystalImage))
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(CrystalImage,2);

for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}



Looks like something to do with your model, raise is along the z axis.

Code: [Select]
mountPoint = $HeadSlot;
   
Are you sure its called "HeadSlot" and not head? I've not really a scripter, but I've done programming before.

Code: [Select]
mountPoint = $HeadSlot;
   
Are you sure its called "HeadSlot" and not head? I've not really a scripter, but I've done programming before.
Nah, it's right according to other scripts.

Is your model in the center of the axis?

Is your model in the center of the axis?

Not sure my partner made the moddel

is it suppose to be centered?


Ye-
Damn. Beat me to it. :/

Yes.

Model is centered however still its not working?

Is it the script?
« Last Edit: August 04, 2010, 03:23:35 PM by Soon To Be »

It might be the fact you're mounting to slot 2.

for everything with mounting and unmounting, change 2 to $HeadSlot

It might be the fact you're mounting to slot 2.

for everything with mounting and unmounting, change 2 to $HeadSlot

Okay honestly i posted here because i have absolutely no scripting knowledge i took a pre-made script and edited it.


So could you possibly post the script that i should use ?

Code: [Select]
datablock ShapeBaseImageData(CrystalImage)
{
shapeFile = "./Crystal.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "0.1 5 5";
doColorShift = false;
colorShiftColor = "50.000 50.000 50.000 255.000";
};

function serverCmdCrystal(%client)
{
%player = %client.player;

if(isObject(%player))
{
if(%player.getMountedImage($headslot) $= nametoID(CrystalImage))
{
%player.unmountImage($headslot);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage($headslot);
%player.mountImage(CrystalImage,$headslot);

for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}


Nope it still wont appear upon entering /crystal

I replaced the crystal model with one of my hat models and the script worked perfectly, it has to be the model...