CODE
key owner;
key avatar;
default
{
state_entry()
{
owner = llGetOwner(); //Gets the owner.
llSetText("Bracelet Box box. All five \nTeam bracelets are in here, touch to get them all!",<1,1,1>, 1);
}
touch_start(integer total_number)
{
avatar == llDetectedKey(0); //Detects the avatar who touched it.
if (avatar == owner)
{
//If the avatar is the same as the owner, gives items.
llSay(0,"Giving 5 items, please wait...");
llGiveInventory(owner, "Green Team Bracelets Box");
llGiveInventory(owner, "Red Team Bracelets Box");
llGiveInventory(owner, "Blue Team Bracelets Box");
llGiveInventory(owner, "Yellow Team Bracelets Box");
llGiveInventory(owner, "Black Team Bracelets Box");
llSay(0, "Rez the boxes onto the ground and place them away from the arena. This is where the team gets their bracelets.");
}
else if (owner != avatar)
{
llSay(0, "This is not yours.");
llSay(0, "Owner is: "+llKey2Name(owner)+", Avatar is: "+llKey2Name(avatar)+".");
}
}
}
It's returning a blank key for some reason.