Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer kunChan;
- integer upChan;
- integer start;
- integer askChan;
- integer amount;
- integer amountMax;
- default
- {
- state_entry()
- {
- llMessageLinked(LINK_ROOT, askChan, "kAmount", NULL_KEY);
- }
- link_message(integer sender, integer channel, string message, key id)
- {
- if(channel == start)
- {
- list msgData = llParseString2List(message, [], []);
- integer kAmount = llList2Integer(msgData, 0);
- amount = kAmount;
- amountMax = kAmount;
- }
- if(channel == askChan)
- {
- list msgData = llParseString2List(message, [":"], []);
- string name = llList2String(msgData, 0);
- integer kAmount = llList2Integer(msgData, 1);
- llOwnerSay((string)kAmount);
- if(name == "kunai")
- {
- llOwnerSay("3" + (string)kAmount);
- amount = kAmount;
- amountMax = kAmount;
- }
- }
- if(channel == upChan)
- {
- if(message == "plus")
- {
- llOwnerSay("increased");
- amountMax += 1;
- amount += 1;
- }
- }
- }
- touch_start(integer total_number)
- {
- llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
- llStartAnimation("throw");
- llSleep(0.5);
- llWhisper(kunChan,(string)llGetOwner() + ":" + "kun2");
- llSleep(0.7);
- amount -= 1;
- llOwnerSay((string)amount);
- if(amount <= 0)
- {
- amount = 0;
- state recount;
- }
- }
- }
- state recount
- {
- state_entry()
- {
- llOwnerSay("You have used up your supply of Kunai's, you must wait five minutes for them to refil");
- llSleep(10);
- llOwnerSay("Kunai's Refilled");
- state default;
- }
- }
Add Comment
Please, Sign In to add comment