ArchayonLegionAdmin Posted September 11, 2019 Share Posted September 11, 2019 Greetings, I'm trying to create a secret wall entrance using the sliding door technique. I'm very new to LSL scripting and I honestly couldn't have gotten as far as I have with the help of friends. The problem is, I can't get any help with adding a whitelist function to the script. Here's what I have so far: ---------------------------------------------------------------------------------- // Movement vector OFFSET = <-2.0, 0.5, 0.0>; float OPENTIME = 0.5; float CLOSETIME = 0.5; // Variables vector vPosition; rotation rRot; float omega=0.0; vector vTargetPos; integer bOpen = FALSE; integer bMoving = FALSE; // Script MoveDoor() { if(!bOpen) { bOpen = TRUE; rRot = llGetRot(); vPosition = llGetPos(); omega=OPENTIME/llVecDist(<0,0,0>,OFFSET); vTargetPos = vPosition+OFFSET*rRot; llSetTimerEvent(OPENTIME); }else { bOpen = FALSE; omega=CLOSETIME/llVecDist(<0,0,0>,OFFSET); vTargetPos = vPosition; llSetTimerEvent(CLOSETIME); } bMoving = TRUE; llSetStatus(STATUS_PHANTOM, TRUE); llSetStatus(STATUS_PHYSICS, TRUE); llMoveToTarget(vTargetPos,omega); } default { state_entry() { rRot = llGetRot(); vPosition = llGetPos(); } touch_start(integer num_detected) { MoveDoor(); } timer() { bMoving = FALSE; llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS, FALSE); llSetStatus(STATUS_PHANTOM, FALSE); llSetPrimitiveParams([ PRIM_POSITION, vTargetPos, PRIM_ROTATION, rRot ]); } } ---------------------------------------------------------------------------------- I know about llGetOwner and llSameGroup, but I specifically want a whitelist so that I can manually add/remove visitors as needed. If anyone could help me with that, I would very much appreciate it. Link to comment Share on other sites More sharing options...
Kardargo Adamczyk Posted September 11, 2019 Share Posted September 11, 2019 Something like this? // Movement vector OFFSET = <-2.0, 0.5, 0.0>; float OPENTIME = 0.5; float CLOSETIME = 0.5; // Variables vector vPosition; rotation rRot; float omega=0.0; vector vTargetPos; integer bOpen = FALSE; integer bMoving = FALSE; // access list list accesslist = ["Kardargo Adamczyk","dummy2","dummy3"]; // Script MoveDoor() { if(!bOpen) { bOpen = TRUE; rRot = llGetRot(); vPosition = llGetPos(); omega=OPENTIME/llVecDist(<0,0,0>,OFFSET); vTargetPos = vPosition+OFFSET*rRot; llSetTimerEvent(OPENTIME); }else { bOpen = FALSE; omega=CLOSETIME/llVecDist(<0,0,0>,OFFSET); vTargetPos = vPosition; llSetTimerEvent(CLOSETIME); } bMoving = TRUE; llSetStatus(STATUS_PHANTOM, TRUE); llSetStatus(STATUS_PHYSICS, TRUE); llMoveToTarget(vTargetPos,omega); } default { state_entry() { rRot = llGetRot(); vPosition = llGetPos(); } touch_start(integer num_detected) { string name = llKey2Name(llDetectedKey(0)); if (~llListFindList(accesslist,[name])) { MoveDoor(); } } timer() { bMoving = FALSE; llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS, FALSE); llSetStatus(STATUS_PHANTOM, FALSE); llSetPrimitiveParams([ PRIM_POSITION, vTargetPos, PRIM_ROTATION, rRot ]); } } 1 Link to comment Share on other sites More sharing options...
ArchayonLegionAdmin Posted September 11, 2019 Author Share Posted September 11, 2019 8 minutes ago, Kardargo Adamczyk said: Something like this? // access list list accesslist = ["Kardargo Adamczyk","dummy2","dummy3"]; Yeah, exactly like that. I'm disappointed I couldn't figure that out for myself, but I really appreciate the help. That's pretty much exactly what I was looking for. The question is solved. Thank you very much. 2 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