Mulligan Silversmith Posted March 23, 2011 Share Posted March 23, 2011 So I added a Rank(Speical Person) Item giver as well with old Group giver. So both are most the same, the only differents is with the Rank giver you need to add player Names you wish to give items to. Group Giver: //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! } } } 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! } } Please Report Bugs/Problems! 2 1 Link to comment Share on other sites More sharing options...
Dora Gustafson Posted March 23, 2011 Share Posted March 23, 2011 Nice, simple and useful:smileyhappy: I have to point out the redundant code in your if (a) {} else if (!a) {} construct. if (group==TRUE) {} else if (group==FALSE) {} andif (group==TRUE) {} else {}are logically the same 1 Link to comment Share on other sites More sharing options...
Void Singer Posted March 23, 2011 Share Posted March 23, 2011 you might want to check out the following site as well since I see you added a license statement... http://creativecommons.org/licenses/ I personally use the CC-BY license (which is equivalent to what you have above) /*//-- License Text --//*//*// Free to copy, use, modify, distribute, or sell, with attribution. //*//*// ©2011 (CC-BY) [ http://creativecommons.org/licenses/by/3.0/ ] //*//*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*//*// All usages must contain a plain text copy of the previous 2 lines. //*//*//-- --//*/ and CC0 license (for when something is to general, or I don't care about credit) /*//-- Anti-License Text --//*//*// Contributed Freely to the Public Domain without limitation. //*//*// 2011 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0/ ] //*//*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*//*//-- --//*/ obviously they have others, but the liscenses are very easy to understand for layman, and pretty well written. 1 Link to comment Share on other sites More sharing options...
Mulligan Silversmith Posted March 23, 2011 Share Posted March 23, 2011 @Dora Gustafson hehe thanks again I need to debug my code before posting. I even just learned this is my c++ class, it's durty coding, it runs but it looks sloppy I would get slap in class for something like this maybe next time Link to comment Share on other sites More sharing options...
Mulligan Silversmith Posted March 23, 2011 Share Posted March 23, 2011 Thanks for the licences info, I posted one cause of my friend that would slap me around for not posting one cause of class we take together Thanks again Link to comment Share on other sites More sharing options...
Persephone Emerald Posted March 25, 2011 Share Posted March 25, 2011 What about a script that would allow only members of a particular group to receive an item *without* having the object set to that group? This could be useful in in intersim RP. Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted March 25, 2011 Share Posted March 25, 2011 LSL does not have the functions necessary to see if someone is in a specific group, only to see if they are in 'this group'. Link to comment Share on other sites More sharing options...
Mulligan Silversmith Posted March 26, 2011 Share Posted March 26, 2011 Yea you really cannot make it so object can tell who what in a group rank. You would have to setup some kinda of whitelist telling the object/script who what rank. But you would also have to update everytime someone new add or leaves. I added a Rank Item Giver back at the Top! Hope that works out well Link to comment Share on other sites More sharing options...
Darktoorper Amat Posted July 12, 2017 Share Posted July 12, 2017 I realize this is a very old script but I've been using it to this day. I'm curious as to the fact that is it possible to have the object set to a specific group for example a land group and have it only give items to for example a military group that is not part of the land group. Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 12, 2017 Share Posted July 12, 2017 1 hour ago, Darktoorper Amat said: is it possible to have the object set to a specific group for example a land group and have it only give items to for example a military group that is not part of the land group. No. A script cannot detect what groups you belong to. It can only detect what group you have set currently as your active group -- that is, the one that shows in the tag over your head. When you use llSameGroup or llDetectedGroup, the script matches your active group with its own. That will usually be the group that the land it's on has been set to. There is a sort of hack that you can get away with sometimes. Basically, it involves putting your script into two separate prims -- one set to the land group and one set to another group -- and then linking them (or you can put one script in the root prim and then use llDetectedLinkNumber to tell which one a visitor touches). If you do that, a visitor can touch one prim and be recognized by the land group and touch the other one and be recognized by the other group. That trick will only work as long as you don't take the linkset back to inventory and re-rez it, and it can fail spontaneously for other reasons. Link to comment Share on other sites More sharing options...
Qwalyphi Korpov Posted July 13, 2017 Share Posted July 13, 2017 There was a similar discussion last year where llGetAttachedList was mentioned as a way to... usually determine an AVs currently active group key. Might come close enough. Comments by Qie Niangao mentioned GetAttachedList and listed exception conditions. Link to comment Share on other sites More sharing options...
Envy Yuhara Posted June 5, 2018 Share Posted June 5, 2018 Keep up with the great work!!? & Thank youuuuuuuu This will be at great use when I need this kind of scrip!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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