was trying to make a switch with dual functions.When triggered the first time it disable a protection and when triggered again it enable the protection disabled before.......
waht i got in Moh radiant:
script_model
Code: Select all
targetname/laser_switch
model/animate/alarmswitch.tikCode: Select all
targetname/laser_trigger setthread/ship_alertCode: Select all
ship_alert:
self nottriggerable
for(local.i=1;local.i <= $laser_trigger.size;local.i++)
{
if($laser_trigger[local.i].isused !=1 )
{
$laser_switch anim turn_on
$laser_switch playsound click_switch
iprintln "The ship is out of protection"
}
else
{
$laser_switch anim turn_off
$laser_switch playsound click_switch
iprintln "Protection enable"
}
}
waitframe
self triggerable
end the first action work fine the anim is turned on , and i can see in the screen " the ship is out of protection" , but when i try a second time only the first sequence is played again .......anim dont want to turn off nor display my other message ....
can someone help plz ?
