Post your scripting questions / solutions here
Moderator: Moderators
-
At0miC
- General
- Posts: 1164
- Joined: Fri Feb 27, 2004 11:29 pm
- Location: The Netherlands
Post
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
-
Elgan
- Site Admin
- Posts: 890
- Joined: Tue Apr 13, 2004 10:43 pm
- Location: uk
-
Contact:
Post
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
-
At0miC
- General
- Posts: 1164
- Joined: Fri Feb 27, 2004 11:29 pm
- Location: The Netherlands
Post
by At0miC »
Thanks
And how do u make a blinking light, when the player is inside the trigger?
like on and off every 1 seconds.
thnx again
-
Elgan
- Site Admin
- Posts: 890
- Joined: Tue Apr 13, 2004 10:43 pm
- Location: uk
-
Contact:
Post
by Elgan »
At0miC wrote:Thanks
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