my furniture. Two things happening now.
First, once linked, the chair(for example) I made, now gets the name of the poseball and
the poseball creator as the chair's creator as well.
How to prevent this?
Second, it still keeps showing the wrong sit animation.
Anyone who knows, please help...
This is the script hat is in the poseball
I also have simple sitscripts myself but dont know how that works...
////////////////////////////////////////////////////////////////////////////////////////////////////
//// Poseball / Sit script - A bit more complex and failsave sit-script for poseballs and furniture
//// ©2007 by Will Oppewall - All rights reserved
//// This script may not be sold or given away to third persons with MODIFY permissions.
//// This script is sold without any warranties!
////////////////////////////////////////////////////////////////////////////////////////////////////
// CONFIG SECTION
// Sit Position relative to the ball
// this may never be a ZERO_VECTOR (<0,0,0>

vector POSITION=<0.0,0.0,0.2>;
// Rotation of the avatar on the sitposition
vector ROTAT = <0,0,-90>;
// color of the hover-text
string textcolor = "255,255,255";
// intense of the hover-text (alpha-value) between 0.0 and 1.0
float textintense = 1.0;
// text of the hover-text when free
string freetext = "";
// text of the hover-text when occupied
string occtext = "";
// Sit text in pie menu
string pietext = "Sit";
// Automatically search for an animation in the poseball by setting animation to "" - the first found animation will be used then
// To enable a specified animation out of the prims inventory you can enter the name of the animation
string animation = ""; // auto search
////////////////////////////////////////////////////////////////////////////////////////////////////
//// PROGRAM PART
//// DO NOT CHANGE SOMETHING BELOW THIS LINE, EXCEPT YOU KNOW WHAT YOU'RE DOING!!!
////////////////////////////////////////////////////////////////////////////////////////////////////
// GHV - Global Helper Variables -> you should never change their values!
vector textrgb; // rgb value converted to color vector
key avatar; // avatar sitting on poseball
////////////////////////////////////////////////////////////////////////////////////////////////////
//// FUNCTION SECTION
init() { // Initialize poseball on rez or script-start
list rgb = llCSV2List(textcolor);
string tdum = "<"+(string) (llList2Float(rgb,0)*(1.0/255.0))+","+(string) (llList2Float(rgb,1)*(1.0/255.0))+","+(string) (llList2Float(rgb,2)*(1.0/255.0))+">";
textrgb = (vector) tdum;
ROTAT *= DEG_TO_RAD;
rotation quat = llEuler2Rot(ROTAT);
llSitTarget(POSITION, quat);
if (pietext != ""
{llSetSitText(pietext);
}
llSetText(freetext, textrgb, textintense);
avatar = NULL_KEY;
if (animation == ""
{ // If no animation is specified use the first animation that can be found in the contentanimation = llGetInventoryName(INVENTORY_ANIMATION, 0);
}
if (animation == ""
{animation = "sit_ground";} // Fallback animation that will be used if no animation is foundfree();
}
////
start_animation(integer who) {
if (llGetAgentSize(avatar) == ZERO_VECTOR) {llUnSit(avatar);free();return;}
if (avatar != NULL_KEY) {
llStartAnimation(animation); // Start animation
occupied(); // Set poseball occupied
llSetTimerEvent(10);
}
}
////
occupied() { // called when ball gets occupied
llSetAlpha(0.0, ALL_SIDES);
llSetText(occtext, textrgb, textintense);
}
////
free() { // called when ball gets free again
llSetAlpha(1.0, ALL_SIDES);
llSetText(freetext, textrgb, textintense);
avatar = llAvatarOnSitTarget();
}
////
stopAnim() { // stop all animations of the avatar
if (llGetAgentSize(avatar) == ZERO_VECTOR) {return;} // avatar isn't in the sim any more, just quit
list l=llGetAnimationList(avatar); // cleanup animations of avatar - get animationlist
integer mc = llGetListLength(l);
integer k;
for (k=0;k<mc;k++) {
llStopAnimation(llList2Key(l,k)); // Stop all animations of the avatar
llStopAnimation(llList2String(l,k));
}
llStartAnimation("stand_1"
;l=llGetAnimationList(avatar); // cleanup animations of avatar - get animationlist
mc = llGetListLength(l);
for (k=0;k<mc;k++) {
llStopAnimation(llList2Key(l,k)); // Stop all animations of the avatar
llStopAnimation(llList2String(l,k));
}
llSleep(0.5);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//// STATES SECTIONthan
default { // Default state
on_rez(integer channel) { // Reset script on rez (not script reset)
init();
}
state_entry() { // Reset script on script start (not script reset)
init();
}
changed(integer change) {
if (change != CHANGED_LINK) return; // Check if it was sit on / unsit event - return if not.
avatar = llAvatarOnSitTarget(); // Get key of target avatar
// Here we are, if everything is ok till this point.
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { // permissions ok/given
if (llGetPermissionsKey() == avatar) { // if avatar is that one we excpected: animate and return
stopAnim(); // Stop all running animations
start_animation(1);
return; // cancel execution
}
} // if permissions not ok we come here
if (avatar != NULL_KEY) { // ensure we are not dealing with an NULL_KEY
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION); // request permissions of the avatar
free(); // free the poseball
return; // cancel execution
} else {
free(); // dealing with a NULL_KEY - just free the poseball
return; // cancel execution
}
}
run_time_permissions(integer perm) {
llStopAnimation("sit"
;if ((perm & PERMISSION_TRIGGER_ANIMATION) && (llGetPermissionsKey() == avatar)) { //avatar gave permission to animate
stopAnim(); // Stop all running animations
start_animation(2);
}
}
timer() { // When poseball gets occupied, the timer checks if the avatar is still sitting on
if (llAvatarOnSitTarget() == NULL_KEY) { // if avatar left cleanup the poseball
llSetTimerEvent(0);
free();
return;
}
}
}
