if have a weird problem and hope some of you can help.
i have a script with 2 states
state 1 reads a notecard and ask llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
state 2 has a change event with llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
the problem is if i save/reset the script and someone other then the owner sit on the object the animation don't start (run_time_permissions is not started)
if i save/reset the script and first the owner sit on it then the script works (also if someone else sit on it after the owner)
Below part of the script thats give problems (the llWhisper are for testing only).
if the first person that sits on it is not the owner the requestPermission starts but run_time_permissions don't trigger. (i have tried to move PERMISSION_DEBIT to state 2 but that didn't help)
default // Notecard reader
{
state_entry() { // Set some variables}
dataserver(key query_id, string data)
{
// Read Notecard and validate the lines
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer permOwner)
{
if(permOwner & PERMISSION_DEBIT) { state Vendor;}
else { llOwnerSay("You have to grant access else the vendor don't work!"

}
}
state Vendor // Vendor
{
state_entry() { // Set some variables & llSitTarget}
money(key PayingPerson, integer Amount) { //Handles money event }
on_rez(integer num) { llResetScript(); }
changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
llWhisper(0, "Welcome " + llKey2Name(llAvatarOnSitTarget()));
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
}
else
{
integer perm=llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION))
{
llStopAnimation("sit"

llStopAnimation("stand"

llStopAnimation(sAnim);
}
}
}
}
run_time_permissions(integer permAnim)
{
llWhisper(0, "Perm asked"

if (permAnim & PERMISSION_TRIGGER_ANIMATION)
{
llWhisper(0, "Perm granted"

// Set animation
}
}
}