IZHRAH Posted March 12, 2013 Share Posted March 12, 2013 Lets just say we got a simple script like this:touch_start(integer total_number){ key id = llDetectedKey(0); integer sameGroup = llSameGroup(id); if(sameGroup) { llRegionSayTo(id, PUBLIC_CHANNEL, "In the same group."); } else { llRegionSayTo(id, PUBLIC_CHANNEL, "Not in the same group."); }}I created a group with 3 members and I am the object owner, when I set the object to my group or deed it to my group, me the owner when I touched the object I fall to else condition where "Not in the same group". Its confusing that I'm in the same group that I'm expecting to be detected in the same group like the 2 members get.What if I'm creating a device that allows only the owner to touch or access it if not deeded or set to a group, and allows only avatars in the group to access it if deeded or set to a group. Link to comment Share on other sites More sharing options...
DoteDote Edison Posted March 12, 2013 Share Posted March 12, 2013 Only thing I can think of is that you didn't have that particular group tag active when you clicked the object. llSameGroup() only returns TRUE if the matching group tag is active on the avatar. 1 Link to comment Share on other sites More sharing options...
IZHRAH Posted March 12, 2013 Author Share Posted March 12, 2013 Sorry, what do you mean group tag? Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 12, 2013 Share Posted March 12, 2013 The tag over your head --- your GROUP tag. You need to have the group active. It's isn't enough to simply be a member of the group. Now, if you want to test whether a person who touches your object is in your group and wearing the group tag, ask if (llSameGroup(llDetectedKey(0)){ //Detected person is in the same group as your object and is wearing his/her group tag}else{ //Detected person is not in the same group as your object or is not wearing his/her group tag} 1 Link to comment Share on other sites More sharing options...
IZHRAH Posted March 12, 2013 Author Share Posted March 12, 2013 Now It works I understand now the logic of it. If you got multiple groups you must select 1 active. it displays above the Display Name the title. Thanks for figuring that out guys. 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