Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float fishingtime;
- float fishingcounter;
- integer ifishingtime;
- integer Fish = FALSE;
- float counter = 0.0;
- fishtime()
- {
- fishingtime = 10.0 - llFrand(3.0);
- ifishingtime = (integer)fishingtime;
- llSay(0,"Fishing time: "+ (string)fishingtime);
- for(fishingcounter = 0; fishingcounter<= ifishingtime; ++fishingcounter)
- {
- llSetTimerEvent(fishingtime);
- }
- llSleep(0.3);
- }
- default
- {
- state_entry()
- {
- llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
- }
- link_message(integer source, integer num, string str, key id)
- {
- key ownerid;
- ownerid = llGetOwner();
- if(ownerid == id)
- {
- Fish=TRUE;
- }
- }
- run_time_permissions(integer perm)
- {
- key ownerid;
- ownerid = llGetOwner();
- if (perm & PERMISSION_TRIGGER_ANIMATION)
- {
- if(Fish == TRUE)
- {
- fishtime();
- llStartAnimation("Fishing Middle Animation");
- llOwnerSay("animation will end in " + (string)ifishingtime);
- }
- else if(Fish == FALSE)
- {
- llMessageLinked(LINK_THIS, 0, "Fish Script", ownerid);
- }
- //llSetTimerEvent(ifishingtime);
- }
- }
- timer()
- {
- counter = counter + fishingtime;
- llSay(0, (string)counter+" seconds have passed");
- llSetTimerEvent(0);
- llStopAnimation("Fishing Middle Animation");
- Fish=FALSE;
- }
- }
Add Comment
Please, Sign In to add comment