Difference between revisions of "User:Nyeomi Resident"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
user = llDetectedKey(0); | user = llDetectedKey(0); | ||
detectSameGroup = llDetectedGroup(llSameGroup(NULL_KEY)); | detectSameGroup = llDetectedGroup(llSameGroup(NULL_KEY)); | ||
if (detectSameGroup && toggle) | if (detectSameGroup && toggle) | ||
llRegionSayTo(user,PUBLIC_CHANNEL, | llRegionSayTo(user,PUBLIC_CHANNEL, | ||
"\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); | "\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); | ||
else | else | ||
llRegionSayTo(user,PUBLIC_CHANNEL, | llRegionSayTo(user,PUBLIC_CHANNEL, | ||
"\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); | "\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); | ||
} | } |
Revision as of 15:37, 24 October 2013
Using llDetectedGroup & llSameGroup
llDetectedGroup & llSameGroup used seperately both return TRUE if the object is not set to a group (i.e. "(none)") and either the AV with the given key has no group active or the function is called with a NULL_KEY. However if llDetectedGroup is used with llSameGroup as shown in the examples below, the correct value will be returned regardless if the object is or is not set to a group.
touch_end(integer num_detected) { if (llDetectedGroup(llSameGroup(NULL_KEY))) llOwnerSay("Authorized Group"); else llOwnerSay("UnAuthorized Group"); }
The Following is an example of a group only toggle...
touch_end(integer num_detected) { toggle = !toggle; user = llDetectedKey(0); detectSameGroup = llDetectedGroup(llSameGroup(NULL_KEY)); if (detectSameGroup && toggle) llRegionSayTo(user,PUBLIC_CHANNEL, "\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); else llRegionSayTo(user,PUBLIC_CHANNEL, "\n0=FALSE\n1=TRUE\nsameGroup=" + (string)detectSameGroup + "\ntoggle=" + (string)toggle); }