Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGiveMoney and Permissions

Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
05-14-2007 12:30
I've created a system that uses llGiveMoney to pay out employees when they are signed in, based up a few other things. I'm using the state_entry even to get PERMISSION_DEBIT.

My question is this, when I sell this script inside of a container object via a vendor system to other people, will the entry_state trigger when they place the object and therefore the Debit will be coming out of their accounts? I'm 99% sure this is how it works, but I want to be sure before I start selling it and having lindens start disappearing on me =)
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
05-14-2007 13:43
state_entry fires ONLY when the script first starts.

Perhaps back your script up with the changed event and a:

if(change & CHANGED_OWNER) llGetPermissions();
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
05-14-2007 13:58
That seems reasonable, thanks.
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
05-15-2007 03:43
As an alternate option you could have the script reset itself on owner change.

then it will run through the state_entry part.
Speon Beerbaum
Registered User
Join date: 29 Mar 2007
Posts: 11
05-15-2007 09:52
As another alternate you can use:

on_rez(integer foo) {
llResetScript();
}

This will reset the script each time the containing object is rezzed.
Therefore it will enter the state_entry() function, where you request the permission.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
05-15-2007 11:45
Thanks for the responses. The current plan is to use this:

CODE

changed(integer change) {
if (change & CHANGED_OWNER) {
llResetScript();
}
}


I had considered using the on_rez to call llResetScript(), but this way the object could be picked up and moved without resetting everything.