
the function is:
AvatarSit(vector POSITION, vector Rotdeg, integer iNrAnim)
{
if(llGetNumberOfPrims()> iPrimsDefault)
{
llStopAnimation("sit"
; llStopAnimation(SitAnim);
SitAnim=llGetInventoryName(INVENTORY_ANIMATION,iNrAnim);
POSITION=llGetPos()+ POSITION;
llOwnerSay((string)POSITION);
llSetLinkPrimitiveParams(iPrimsDefault +1, [PRIM_POSITION, POSITION, PRIM_ROTATION, llEuler2Rot(Rotdeg*= DEG_TO_RAD)]);
llStartAnimation(SitAnim);
}
}
when i call this function i give the offset compare to the root prim (have to do that for the rotation to but thats not implemented yet) and a integer with the number of the animation it has to load from the invertory.
iPrimsDefault is count of prims without anyone sitting on it.
llOwnerSay give the correct coordination but somehow i sit about 50 m away from the pillow and i don't understand why

EDIT: i am testing it with line POSITION=llGetPos()+ POSITION; disabled
it looks like that the Position is already relative to the root.
but after i move the pillow it the function sometimes don't work anymore and resetting the script don't work then (very weird)
but the rotations isn't relative to the root prim

so i'm hoping someone else steps in.