Timberwatch Posted October 19, 2013 Share Posted October 19, 2013 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! 2 Link to comment Share on other sites More sharing options...
LepreKhaun Posted October 19, 2013 Share Posted October 19, 2013 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 More sharing options...
Xiija Posted October 19, 2013 Share Posted October 19, 2013 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(); } } 1 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