Jump to content

Looking for Stock or Count-Down script - Help appreciated!


Moor Ravenheart
 Share

You are about to reply to a thread that has been inactive for 4390 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello,

I am no scripter and wouldn’t have the foggiest idea how to create this.  But I know the script does exist as I have seen it in various items.  I have searched high and low, and have a script that was given to me by a wonderfully kind player.  But unfortunately the script resets itself when a player re-rezs the item and the messages continue to flash even after the stock is finished. So it kind of defeats the object of lending realism to the Role-Play game and stock shortages.

 

I think it is called a countdown script, which shows a quantity in hovering text over a prim.  When any player touches the prim the quantity drops by 1 and a message is displayed in general chat saying “blah blah, you have removed …..”   

Any AV can click it multiple times, so there should be no restriction there.  Nor should there be a restriction to group either.

The hovering text should drop by one, so let’s say the stock in the prim is 10.  It will now read 9/10.

The script should only allow for the stipulated quantity of clicks (10 in this example) and once it has been clicked 10 times, a new customized message should flash “Sorry, there is no more stock of X, please replenish at market”

Also the floating text on the Prim will say “Out of Stock” once it has been clicked 10 times.

When this happens the prim should be considered worthless, pulled back into inventory and deleted.  A new prim with fresh stock would need to be sourced in-game.

The script should allow me to decide if I wish to deliver an actual item upon touching, or if it can just be a message.

I need this script to create RP items for the Sim I play on, to simulate perishable stock and content.  So I would need something that is full perms and allows me to personalize the messages and content, and decide whether I wish to give an item or simply have a message flash in local chat.

If anyone can assist, or point me in the direction of the actual script I need.  Kindly contact me In-world or send me a NC.

I have tried to explain it in layman terms (because when it comes to scripting it’s all gibberish to me), but if anything isn’t clear from this write-up please let me know also via IM or in-world.

Thanks so much in advance for any help anyone can offer…. 

Link to comment
Share on other sites

//Countdown with giver option by conrad evanier free to use as you like :)string name;integer give = FALSE;integer all;integer ID;integer DC(){integer cc = (integer)llFrand(-2000000);llListenRemove(ID);ID = llListen(cc,"",NULL_KEY,"");return cc;}default{state_entry(){all = (integer)llGetObjectDesc();name = llGetInventoryName(INVENTORY_OBJECT,0);llSetText("I have "+(string)all+" "+name+" left to give.",<0,1,0>,1);}touch_start(integer total_number){key dk;integer i = 0;for (;i < total_number; ++i){dk = llDetectedKey(i);if (dk == llGetOwner()){llDialog(dk,"\n..::Please click an option::..\n\n..::Conrads Creations::..",[":Give on:",":Give off:",":Reset:"],DC());}else if (give){if (all>0){--all;llGiveInventory(dk,name);llSetText("I have "+(string)all+" "+name+" left to give.",<0,1,0>,1);llRegionSayTo(dk,0,"\nYou have removed 1 "+name+" from my contents");}}else if (give == FALSE){if (all>0){--all;    llSetText("I have "+(string)all+" "+name+" left to give.",<0,1,0>,1);llRegionSayTo(dk,0,"\nYou have removed 1 "+name+" from my contents");}}if (all == 0){llSetText("I am all out of stock.",<1,0,0>,1); llSleep(20);llDie();}     }}listen(integer c,string n,key id,string msg){if (msg == ":Give on:"){give = TRUE;llRegionSayTo(id,0,"\nGiving is now on.");llListenRemove(ID);}else if (msg == ":Give off:"){give = FALSE;llRegionSayTo(id,0,"\nGiving is now off.");llListenRemove(ID);}if (msg == ":Reset:"){llRegionSayTo(id,0,"\nNow loading your settings.");llResetScript();}}changed(integer c){if (c & CHANGED_INVENTORY){llResetScript();}}   }

 

Hi heres my simple script to do this, you only need to drop 1 copy trans object into its contents.  Then put the amount to give before it dies in the objects description, you can turn give object on/off from the menu. Text displays name of item to give and how many left, when empty displays I am all out of stock sleeps for 20 secs then dies :)

*eddit im not sure this has saved right lol having trouble loging in and posting 1 min my code is there then i look and its not lmao any ways hope it is :)

 

Link to comment
Share on other sites

I have received so much help and so many offers to help,  

A very special thank you to Innula for her amazing kindness in giving me the script and Conrad for his incredible assistance in giving me an alternative too.

I must admit I didnt think  that I would get the help I needed, as I had been searching and asking some people I knew were scripters for over 3 weeks.  But  today posting on this forum  - I got not one, but two amazing responses and scripts that fit the bill to a T.

Thank you so much to everyone who Im'd me and for renewing my faith in strangers. It isnt every day I am surprised in SL, but today was a true eye opener!

Thank you again!:matte-motes-big-grin:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4390 days.

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
 Share

×
×
  • Create New...