Page 1 of 1

"pling", if you are standing inside a trigger

Posted: Sat Dec 11, 2004 9:02 pm
by At0miC
How can I do this:

If a player is standing inside a trigger-box, a light (lamp) would go on, but if the player goes out of the box, the light should go off again.

Gheers

Posted: Sat Dec 11, 2004 9:11 pm
by Elgan
local.tri = spawn trigger_multiple
local.tri.origin = ( 0 0 0 )
local.tri setsize ( -40 -40 -40 ) ( 40 40 40)
local.tri setthread lights

lights:

$light light_on
while(parm.other istouching self) //while he is inside
{
waitframe //inside
}
//left the trigger area
$light light_off

end

Posted: Sat Dec 11, 2004 9:35 pm
by At0miC
Thanks :wink:

And how do u make a blinking light, when the player is inside the trigger?
like on and off every 1 seconds.

thnx again

Posted: Sat Dec 11, 2004 10:51 pm
by Elgan
At0miC wrote:Thanks :wink:

And how do u make a blinking light, when the player is inside the trigger?
like on and off every 1 seconds.

thnx again
lights:

$light light_on
while(parm.other istouching self) //while he is inside
{
wait 1 //time delay to blink

if(local.light==1)
{
$light light_off
local.light=0
}
else
{
$light light_on
local.light=1
}
}
//left the trigger area
$light light_off

end