-->

FoxSan's 3D Tools and LSL Script Repository

Tons of LSL scripts, examples and 3D tools, free for all. There are currently 207 scripts and articles in this database.

Give Object And Play Sound

// This script will give out a object from Inventory and play sound file when click on.
 
string object_name = "object";
integer i;
 
default
{
    state_entry()
    {
        llPreloadSound(llGetInventoryName(INVENTORY_SOUND, 0));
 
    }
     touch_start(integer total_number)
    {
         integer i;
        key giver;
        // add a wave that is name sound.wav
        llPlaySound("pour", 1.0);
        giver = llDetectedKey(0);
        string name = llDetectedName(0);
        if (giver != NULL_KEY)
        {
            llGiveInventory(giver, object_name);
        }
 }
}

Comments are closed.