Tiara Jarrico Posted March 20, 2013 Share Posted March 20, 2013 I'm looking for a particular script or help in writing the code for it.... The scripts function is to basically count how many times its been rezzed (by being worn and/or drug out), but for the creator to limit the number of times the object is able to be rezzed and then delete when the limit is reached.For example... if I had a prim object that could only be rezzed 3 times, the object would count how many times its been rezzed in local chat ("blah has 2 uses left") and on the 4th time of being rezzed it would instantly "poof" delete ("blah has 0 uses left & will delete").I've tried to search for this but I'm not even sure what key words to use and have had no luck so far :o( ..Thanks for reading and hope someone can help! Link to comment Share on other sites More sharing options...
outtaspace Posted March 20, 2013 Share Posted March 20, 2013 integer max = 3;integer count = 0;default{ on_rez(integer param) { count++; if (count == max){ llOwnerSay("blah has 0 uses left & will delete"); llDie(); } else { integer remaining = max - count; llOwnerSay("blah has " + remaining + " uses left"); } }} Link to comment Share on other sites More sharing options...
Qie Niangao Posted March 20, 2013 Share Posted March 20, 2013 It complicates things that being worn counts as a rezzing because it's impossible to delete a worn attachment (except temporary attachments), and it will continue to be wearable from inventory no matter what any script does. Instead, the script will need to render the thing useless, perhaps by shrinking it down to nothing, changing its name to "delete me", deleting all object contents except maybe the script itself which might go into some trivially useless state that only issues "Please delete me" via llRegionSay() to DEBUG_CHANNEL. Also, it seems if you're going to the trouble to make it delete itself, you'll want to make it no-copy (so you'll want to test it with an alt, so the next-owner perms apply). And you'll probably want it to be no-mod so the deletion script can't simply be removed. If the count has to be really precise, that's a further complication, in which case you'll need to llTakeControls() so the thing can run on no-script land. (Well, technically, keep running on no-script land.) Finally, it's worth noting that each login while wearing the object will count as a new rezzing; if that's a problem, might leverage the fact that the attach() event doesn't fire on logout, but does when an object is actually detached. Link to comment Share on other sites More sharing options...
LepreKhaun Posted March 20, 2013 Share Posted March 20, 2013 That code won't compile... outtaspace wrote: integer max = 3;integer count = 0;default{ on_rez(integer param) { integer count++; if (count == max){ llOwnerSay("blah has 0 uses left & will delete"); llDie(); } else { integer remaining = max - count; llOwnerSay("blah has " + remaining + " uses left"); } }} Link to comment Share on other sites More sharing options...
outtaspace Posted March 20, 2013 Share Posted March 20, 2013 whoops, wrote it on forums 1/2 asleep, i missed many other points Qie pointed out anyway. Link to comment Share on other sites More sharing options...
Monti Messmer Posted March 20, 2013 Share Posted March 20, 2013 Whats about no script regions ? Let´s say a house, rezzed under no scripts would never count up but you could live in forever ;-) Monti Link to comment Share on other sites More sharing options...
Nova Convair Posted March 20, 2013 Share Posted March 20, 2013 If rezzed on a no script parcel (below 75m) the scripts will not run. TakeControls doesn't matter. If you leave the zone scripts will continue to run. (that's very probable in case of an attachment) As said before, a no copy / no mod object is required. Link to comment Share on other sites More sharing options...
Ela Talaj Posted March 22, 2013 Share Posted March 22, 2013 llDetachFromAvatar() on attach event will do the trick. My demos can be worn only once; if rezzed on the ground they die. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now