Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
996 B
7
Indexable
Never
list admins = ["7405e11e-67d8-4ac7-ad98-e9e90316e2e4", "559f590e-7016-4273-ba0d-6d8b6b7c0516", "ba2e1323-4dae-4076-8762-d7bc2317e2f6"]; //Paradox, Iskorka, ObiAi 

integer take_counter;

default
{
    state_entry()
    {        
        take_counter = (integer) llGetObjectDesc();
    }
    
    touch_start(integer total_number)
    {
        integer isAdmin = (llListFindList(admins, [(string) llDetectedKey(0)]) != -1);        
        if (isAdmin == TRUE)
        {
            llSay (0, "The gift was taken " + (string) take_counter + " times.");
            
            if (llGetTime() < 1.0) //Click
            {
                llGiveInventory(llDetectedKey(0), llGetInventoryName(6, 0));  
            }
        }
        else
        {
            llGiveInventory(llDetectedKey(0), llGetInventoryName(6, 0));
            take_counter += 1;
        }
    }
    
    touch_end(integer num_detected)
    {
        llResetTime();    //For click
    }
}
Leave a Comment