string avpass; integer unlocked; default { on_rez(integer start_param) { llResetScript(); } attach(key id) { llResetScript(); } state_entry() { if(llGetObjectDesc() == "Unlocked") { unlocked = 1; } else { unlocked = 0; } string id = (string)llGetOwner(); string name = llKey2Name(llGetOwner()); string namelength = (string)(llStringLength(name)*371); avpass = llGetSubString(id,18,35) + namelength + llGetSubString(id,0,17); llListen(8631,"",llGetOwner(),""); llListen(8631,"",llGetCreator(),""); if(!unlocked) { llSetScale(<0.242,0.242,0.029>); llMessageLinked(LINK_SET,99,"Lock",NULL_KEY); } } touch_start(integer num_detected) { llOwnerSay("If the HUD surface looks blank, it is because the HUD is locked. Get your HUD password from Vance or another TFC admin, and with it unlock the HUD by saying '/8631 unlock passwordhere' (without the quotes)."); } listen(integer channel, string name, key id, string msg) { string desc = llGetObjectDesc(); if(msg == "unlock "+avpass && !unlocked && desc != "Restricted" && id == llGetOwner()) { llOwnerSay("Tripwire HUD unlocked. Enjoy!"); unlocked = 1; llSetObjectDesc("Unlocked"); llSetScale(<0.05,0.05,0.029>); llMessageLinked(LINK_SET,99,"Unlock",NULL_KEY); } else if(msg == "reset lock" && id == llGetOwner() && desc != "Restricted") { llOwnerSay("Tripwire HUD lock reset."); unlocked = 0; llSetObjectDesc("Locked"); llSetScale(<0.242,0.242,0.029>); llMessageLinked(LINK_SET,99,"Lock",NULL_KEY); } else if(msg == "get pass" && llGetOwner() == llGetCreator()) { llOwnerSay(avpass); } else if(msg == "hud query" && id == llGetCreator()) { llInstantMessage(llGetCreator(),llKey2Name(llGetOwner())); } else if(msg == "restrict "+llKey2Name(llGetOwner()) && id == llGetCreator() && desc != "Restricted") { llOwnerSay("Your HUD access has been restricted."); llSetObjectDesc("Restricted"); unlocked = 0; llSetScale(<0.242,0.242,0.029>); llMessageLinked(LINK_SET,99,"Lock",NULL_KEY); } else if(msg == "unrestrict "+llKey2Name(llGetOwner()) && id == llGetCreator() && desc == "Restricted") { llOwnerSay("Your HUD access has been restored."); llSetObjectDesc("Locked"); unlocked = 0; llSetScale(<0.242,0.242,0.029>); llMessageLinked(LINK_SET,99,"Lock",NULL_KEY); } } }