Jump to content

Group gift script not working


DAT4BASE
 Share

You are about to reply to a thread that has been inactive for 1554 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hey guys, so i'm trying to set up a group gift for customers at my mainstore location. It's on land that i rent, so i don't own the place, but i'm in the land group so i can edit things on my plot.

aaanyway, i have my OWN group for my customers, separate from my land owners' group, and i would like for only the people in MY own group to be able to receive the gift. However, at the moment with this script i found on a slightly older forum post, purchasers of the gift have to be in the land group instead of my group, and i'm no scripting expert so i'm not really sure what to change to make it the other way around?

here's the script i'm using:

// Group gift / join script released into public domain by Qie Niangao, 2009.

key GROUP_KEY = "472ad9bd-3f23-8158-00d6-6e36e441c855";
// Get the GROUP_KEY from its web page, found with
// Search / All or from
// http://search.secondlife.com/web/search/groups/?q="Group Name"
// At the bottom of the group's web page is its URL,
// the end of the URL is the group's key.

string GIVING_MSG = "Here's a free gift! Hope you enjoy &heart;";

string JOIN_MSG = "You need to be a member of the DAT4BASE V.I.P group to get this gift.  If you're not a member, type Control-H to get the chat history, and click on the following blue-highlighted text, then Join.  ";

string NOT_ACTIVE_MSG = "Or perhaps you're already a member and just don't have this group active at the moment; if so, click on the following text, choose the group from the list, and Activate.  ";

string FOLDER_NAME = "DAT4BASE GROUP GIFT";

// ____________________________________________
// END OF STUFF MOST USERS WOULD WANT TO CHANGE
// --------------------------------------------

string GROUP_URI = "secondlife:///app/group/";
list giftContents;

default
{
    state_entry()
    {
        // In lieu of other specs, we'll just give everything in the object's inventory except this script
        // in a new folder named FOLDER_NAME.
        integer invIdx = llGetInventoryNumber(INVENTORY_ALL) - 1;
        string scriptName = llGetScriptName();
        for (; invIdx >= 0; invIdx--)
        {
            string invItemName = llGetInventoryName(INVENTORY_ALL, invIdx);
            if (invItemName != scriptName)
                giftContents += invItemName;
        }
        if ([] == giftContents)
            state no_contents;
        else
            llWhisper(0, "Will give folder named \"" + FOLDER_NAME + "\" containing these items: "
                + llDumpList2String(giftContents, ", "));
    }
    changed(integer change)
    {
        if (CHANGED_INVENTORY & change)
            llResetScript();
    }
    touch_start(integer total_number)
    {
        key toucher = llDetectedKey(0);
        if (llSameGroup(toucher))
        {
            llInstantMessage(toucher, GIVING_MSG);
            llGiveInventoryList(toucher, FOLDER_NAME, giftContents);
            return;
        }
        llInstantMessage(toucher, JOIN_MSG + GROUP_URI + (string)GROUP_KEY + "/about\n"
            + NOT_ACTIVE_MSG + GROUP_URI + "list/show");
    }
}

state no_contents
{
    state_entry()
    {
        llWhisper(DEBUG_CHANNEL, "Nothing to give; please add one or more gift items.");
    }
    changed(integer change)
    {
        if (CHANGED_INVENTORY & change)
            llResetScript();
    }
}

hopefully i've provided all the information i need to. i just have the script and the gift items in a regular shmegular square object with touch permission. so yeah, any help would be greatly appreciated, as i'm trying to treat my customers and come across as totally professional.

thanks ❤️

Link to comment
Share on other sites

The important bit in that script is this part:

if (llSameGroup(toucher))
{
  llInstantMessage(toucher, GIVING_MSG);
  llGiveInventoryList(toucher, FOLDER_NAME, giftContents);
  return;
}

This checks if the avatar is in the same group as the object itself.

You're probably using Firestorm and you've probably set your viewer to "always rez objects under land group."

Select your object, go to the main tab in the edit window, and change the object's group to your own group. 🙂

Edited by Wulfie Reanimator
Link to comment
Share on other sites

7 minutes ago, Wulfie Reanimator said:

You're probably using Firestorm and you've probably set your viewer to "always rez objects under land group."

Select your object, go to the main tab in the edit window, and change the object's group to your own group. 🙂

Or make a small parcel (4m x 4m) in your store and deed it to your own group.  Then rez the gift giver on that parcel.

Link to comment
Share on other sites

22 minutes ago, Wulfie Reanimator said:

The important bit in that script is this part:


if (llSameGroup(toucher))
{
  llInstantMessage(toucher, GIVING_MSG);
  llGiveInventoryList(toucher, FOLDER_NAME, giftContents);
  return;
}

This checks if the avatar is in the same group as the object itself.

You're probably using Firestorm and you've probably set your viewer to "always rez objects under land group."

Select your object, go to the main tab in the edit window, and change the object's group to your own group. 🙂

thanks so much. i actually found the site http://www.aliciastella.com/ in the meantime and it has like 90% of all SL relevant scripts. but thanks so much anyway!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1554 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...