key AvKey;
startsensor()
{
llSensorRepeat("", AvKey, AGENT, 20.0, PI, 10.0);
llSetTimerEvent(90);
}
default
{
touch_start(integer total_number)
{
AvKey = llDetectedKey(0); startsensor();
}
sensor(integer num_det)
{
integer i; for(i = 0; i < num_det; i++)
{
if (AvKey == llDetectedKey(i))
{
llSay(0, llGetUsername(AvKey) + " Detected");
}
else {llShout(0, "Not Detected"); //this bit not working
}
}
}
timer()
{
llSensorRepeat("", AvKey, AGENT, 10.0, PI, 0.0);
}
}
I can't get the "else" bit to work for some reason. It's for a game where I don't want people cheating by going close to the object. It's just as important to know when they aren't in range.