Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stupid Drinking Scripts...

perttu Kitty
I was here?
Join date: 17 Dec 2004
Posts: 23
06-05-2005 21:14
People keep telling me they get an error involving the PERMISSION_TRIGGER_ANIMATION and it's really annoying me. does anyone know why it appears and how to get rid of the stupid thing...


[script]
integer flag = 0;


default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
llWhisper(0,"With Love From The Little Kitty With The Big Bottle";);
}

run_time_permissions(integer parm)
{
if(parm == PERMISSION_TRIGGER_ANIMATION)
{
llSetTimerEvent(15);

llStartAnimation("hold_R_handgun";);
}

}

on_rez(integer st)
{
llResetScript();
}

attach(key id)
{
llStopAnimation("hold_R_handgun";);
}




timer()
{

if(flag == 1)
{
llStartAnimation("drink";);
}



if(flag == 3)
{
llStartAnimation("drink";);
}

flag = flag + 1;

if(flag == 4)
{
flag = 0;
}

}




listen(integer channel, string name, key id, string message)
{
}


}
[/script]
_____________________
There's enough hatered in the world we don't need any on Second Life.
Kali Dougall
Purple and Spikey
Join date: 5 Feb 2005
Posts: 98
06-05-2005 22:16
state_entry is only run once, when the script first starts... it needs to request permissions when attached instead.
CODE
attach(key id) {
if (id == NULL_KEY) {
llStopAnimation("hold_R_handgun");
} else {
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
}
}
_____________________

[ Kali's Purple Pantechnicon ]
Eldora (119, 147)
[ Final Fantasy Pyreflies ~ Multigame Target Launcher ~ CyberGoggles/BLISS Goggles ~ Other Scripted Gadgets ~ Fashion Accessories ~ Miscellanea ]