Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Place this script into a furniture object that you would like to restrict to certain users in a white list. When an avatar sits, it will check if the avatar is the owner. If it's not, it will then check if they are in the white list, if not, they will be Unsat
- //Edit the white list below to include the names of the avatars you would like to allow to use your furniture. No need to include "Resident" in the name, and the functions used below are not case sensitive.
- list whitelist = ["some name", "some name 2"];
- //Do Not Edit Below This Line Unless You Know What You're Doing
- list keys;
- key inq;
- integer len;
- integer index;
- default
- {
- state_entry()
- {
- len = llGetListLength(whitelist);
- index = 0;
- inq = llRequestUserKey(llList2String(whitelist,index));
- }
- dataserver(key datainq, string data)
- {
- if(datainq == inq)
- {
- if((key)data)
- {
- keys += [(key)data];
- }
- index++;
- if(index < len)
- inq = llRequestUserKey(llList2String(whitelist,index));
- }
- }
- changed(integer change)
- {
- if(change & CHANGED_LINK)
- {
- key id = llAvatarOnSitTarget();
- if(id)
- {
- if(id != llGetOwner())
- {
- if(llListFindList(keys, [id]) == -1)
- {
- llUnSit(id);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement