Hey all, I'm fairly new to scripting. I have a little experience with XML and HTTP. I've searched all over and tried multiple different LSL script variations (and more than likely it's just because I've gone down the rabbit hole and the answer is obvious), but I'm trying to make a simple script to push a button down and have it pop back up. It will have a whitelist and a sound as well when it's pushed. It's a linked prim #2 of 2. Here's what I have so far, I have the script inside the linked #2 prim. The sound plays, but the button does not move. (I haven't put the whitelist ID#s in yet)
Added picture- the white part is the prim I want to move down then up after a short delay.
Thank you for your help!
list gAvWhitelist = ["","",""];
integer toggle = -1;
integer toggle2 = -1;
move(vector direction)
{
integer p = 0;
integer n = 10;
for (; p < n; ++p) {
llSetPos(llGetPos() + direction);
}
}
default
{
touch_start(integer total_number)
{
list Properties = llGetObjectDetails(llGetKey(),[OBJECT_CLICK_ACTION]);
integer Click = llList2Integer(Properties,0);
if (!Click && (~llListFindList(gAvWhitelist,[(string)llDetectedKey(0)])) )
{
llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1);
}
{
toggle = ~ toggle;
if(toggle)
llSetTimerEvent(1);
else
llSetTimerEvent(0);
}
}
timer()
{ toggle2 = ~ toggle2;
if(toggle2)
move(<0,0,-0.5>);
else
move(<0,0,0.5>);
}
}