View difference between Paste ID: 7nvtf7nX and XRvvwAfq
SHOW: | | - or go back to the newest paste.
1-
integer spawn_check;
1+
integer out  = FALSE;
2-
 default
2+
integer rod_equip = FALSE;
3
 
4-
    state_entry()
4+
//time 15 seconds delay for it to be visible
5
 
6
 
7-
         llListen(-11223,"Fish Pond","","");
7+
default
8
{
9
     state_entry()
10
    {
11-
     
11+
        llListen(-11223,"Fishing Rod",NULL_KEY,"");
12
        //llSetScriptState("ToggleFish",FALSE);
13
                          
14-
        /*
14+
15-
        while(msg == "CheckRod"&&spawn_check==TRUE)
15+
    //listen for fishing rod is equip
16
    listen(integer channel, string what, key who, string msg)
17-
            llSay(-11223,"testloopp");
17+
18-
            llSay(-11223,"Equip");  
18+
        llOwnerSay(what + ": " + msg);
19-
            if(spawn_check==FALSE)
19+
        //if(llDetectedKey(0) == llGetOwner())
20
        //else
21-
                llSay(-11223,"UnEquip");  
21+
       // if(llGetOwnerKey(who) == llGetOwner())
22-
                llSay(-11223,"breakloop");
22+
       // {
23-
                break;
23+
           
24
           // This code will only run if the pond owner is also the rod owner. Students will not own the pond so this block cant run.
25
         if(what == "Fishing Rod") // Instead check if the object sending messages to the pond is the fishing rod
26-
        */
26+
         { 
27
         
28-
                     
28+
         llOwnerSay("message from fishing rod.");
29-
        if(msg == "CheckRod")
29+
30-
        {     
30+
            if(msg=="Equip" )
31-
                
31+
32-
            llSay(-11223,"Equip");  
32+
               llSay(0, "rod equipped"); 
33
               rod_equip = TRUE;
34
               //llSetScriptState("ToggleFish",TRUE);
35
               return;
36
            }
37
            else
38
            {
39
                 llSay(0, "rod not equipped"); 
40-
	/*
40+
                rod_equip = FALSE;
41-
    attach(key id)
41+
                return; 
42
            }
43-
        //llSay(-11223, (string) llGetKey());
43+
            /*
44-
        llOwnerSay(llGetKey());
44+
            else if(msg =="UnEquip") 
45-
        id = llGetKey();
45+
46-
        if(id == NULL_KEY)
46+
               rod_equip = FALSE;
47
               return;
48-
            spawn_check = FALSE;
48+
49
            */
50-
        else if(id != NULL_KEY)
50+
51
                        
52-
            spawn_check = TRUE;
52+
53
    
54-
                
54+
    touch_start(integer total_number)
55-
    } 
55+
56
        //ask for the fishing rod
57
        llRegionSayTo(llGetOwner(),-11223,"CheckRod");
58-
    on_rez(integer start_param)
58+
        llSay(-11223,(string) llGetKey());
59
        if(out == TRUE && rod_equip == TRUE)
60-
        spawn_check = TRUE;
60+
61
            out = FALSE;       
62-
        frod = llDetectedKey(0);
62+
            llSay(10,"off");          
63-
        if(msg == "CheckRod")
63+
            return;
64-
        {      
64+
65-
            llSay(-11223,"Equip");
65+
66
        else if(out == FALSE && rod_equip == TRUE)
67
        {
68-
    } 
68+
            out = TRUE;
69-
    */
69+
            llSay(10,"on");
70
            return;
71
        }
72
        
73
        // instead of setting out to TRUE and FALSE in the touch event do:
74
75
       // Out = !Out;   
76
       
77
       //This will toggle Out between True and False
78
79
        // Then you dont have to set out to true or false in the if statements
80
        
81
        
82
        
83
        
84
    }
85
    
86
   
87
}