Group/Rank Item Giver

Written by: Headmaster

Written by Mulligan Silversmith:

This is the group Giver Script:

 

//Make sure to set the objects Group to same as below.. It's under General Object Options!

string item = "Object"; // The item you would like to give out
string group_name = "Linden Lab"; // The group you would like to give the item to
default
{
    on_rez ( integer start )
    {
        llResetScript(); // Resets the script on rez
    }

    touch_start(integer total_number)
    {
        integer group = llSameGroup(llDetectedKey(0)); // checks to see if the person clicking on the object has the same active group as the object, returns TRUE or FALSE
        if ( group == TRUE )
        {
            llGiveInventory(llDetectedKey(0), item); // gives the item to the person who clicked on the object
            llSay(0, "Thank You");
        }
        else if ( group == FALSE )
        {
            llSay(0, "Only members of the group " + group_name + " may receive the inclosed item. If you are a member of the group " + group_name + " please put on your gourp tag try again.");
            // Tell who ever click on it that they don't have their tag on or they are not apart of group!
        }
    }
}

 

From Silversmith:

Rank Giver: With this script make sure add the player name in list! Remember to add the old account name of player and not new display one. Also you could change it so it checks if player in the group and on list but I figured that take more time to send out items. Cause they are already on list O.o

string item = "Object"; // The item you would like to give out
list Names = ["Mulligan Silversmith","Mulligan Linden","Mulligan Pimp"]; // The names of people you want give items too
/*
For the name you need type it how it is on their profile with Caps and lower Cases
*/
default
{
    on_rez ( integer start )
    {
        llResetScript(); // Resets the script on rez
    }

    touch_start(integer total_number)
    {
        integer who; // Who is touching me!
        integer Index;
        Index = llListFindList(Names, [llDetectedName(who)]);
            if (Index > -1)
            {
                llGiveInventory(llDetectedKey(0), item); // gives the item to the person who clicked on the object
                llSay(0, "Thank You");
            }
            else
                llInstantMessage(llDetectedKey(who), "Sorry, your name is not on the list."); // Let them know their name not on the list!
        }
}