Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This script compares the avatar's active group to any specified group in the script and not the group the object has active. To check if an avatar's active group is the same as the object's active group use llSameGroup or llDetectedGroup.
- // There is no direct way to get the active group key of an avatar but you can get the active group key of one of their attachements which is the same as the avatar's active group.
- key groupId = "d1228743-d417-938b-db90-52081ed656ba"; // add the key of the group you would like to check if the avatar is a member of
- default
- {
- touch_end(integer total_number)
- {
- key Toucher =llDetectedKey(0); // get the key of the avatar who touched the prim
- list attachments = llGetAttachedList(Toucher); // get the list of attachments the avatar is wearing
- key a = llList2Key(attachments,0); // get the key of the first attachment in the list
- list det = llGetObjectDetails(a, [OBJECT_GROUP]);
- // get the active group of the attachment as it will be the same as the active group of the avatar.
- key avatarGroupKey = llList2Key(det,0); // the key will be the first item in the det list
- if(avatarGroupKey == groupId) // if the avatar's active group and the groupId are the same
- {
- // do stuff
- llSay(0,"You are a member of the group!");
- }
- else
- {
- llSay(0,"You are not a member of the group or you haven't got the right group actvated. Please activate the secondlife:///app/group/"+(string)groupId+"/about group. Also please wear at least one attachement. ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement