Jump to content
Sign in to follow this  
_qor

Script-created trigger doesnt work

Recommended Posts

Hey,

its just about this script that is not working:

_trg1 = createTrigger ["EmptyDetector", getPos FC1veh];
_trg1 setTriggerArea [20, 20, 0, false];
_trg1 setTriggerActivation ["ANY", "PRESENT", true];


if (EAST countSide list _trg1 == 0) then {hint "free to delete"} else {hint "occupied"};

Of course the necessary conditions to fire the trigger are fulfilled.

Got an idea what might be wrong?

Edited by _qoR

Share this post


Link to post
Share on other sites

The problem is a trigger only fires once every half a second so when you create the trigger it needs half a second to activate, the if statement has already run by the time the trigger fires so list _trg1 when checked in the if statement hadn't been created so nothing happens.

Place a sleep between the trigger and if statement sleep 1;

I would however use this instead

_trg1 setTriggerStatements ["this", "if (EAST countSide list thistrigger == 0) then {hint 'free to delete'} else {hint 'occupied'};", ""];  };

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Great, it works this way.

Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×