Jump to content

Limit use giver script


Timberwatch
 Share

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

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

Recommended Posts

I am working with a friend to create some food items for an RP sim. I would like to be able to create a script that gives out food in limited quantities for realism. For instance a sandwhich would only give out 5 of them and then would not allow for anymore. I have a giver script but I am struggling with how to make it so it only gives out the limited quantity. Any one have a suggestion? Or know of one that I can buy that is already out there? Thanks!

  • Like 2
Link to comment
Share on other sites


Timberwatch wrote:

I am working with a friend to create some food items for an RP sim. I would like to be able to create a script that gives out food in limited quantities for realism. For instance a sandwhich would only give out 5 of them and then would not allow for anymore. I have a giver script but I am struggling with how to make it so it only gives out the limited quantity. Any one have a suggestion? Or know of one that I can buy that is already out there? Thanks!

One or more of these apply:

 

  • Use a global variable to keep track of how many food items have been given out.
  • Use a conditional statement to limit how many food items to give out.
  • Learn LSL to write your own programs instead of asking on the forums for others to do it for you.
  • Use the "Inworld Employment" forum to hire a scripter.
Link to comment
Share on other sites

the global variable Leprekhaun mentioned should work,

integer count;

---------- and in your touch event....----

 touch_start(integer n)
    {   ++count;                 
       if( count < 6)

         {  llGiveInventory(llDetectedKey(0),"sandwich"); }

         else

         {   llDie();   }  
    }

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3879 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...