Jump to content
Sign in to follow this  
infiltrator_2k

!alive Condition Not Working?

Recommended Posts

This is bloody annoying me. Why is it when script something as simple as " If !(alive sniper) then {hint "the sniper is dead"}; " it doesn't work. Yet if I remove the exclamation to check if the object is alive it works. I've tried running it from both the init field and a script but it doesn't work.

Share this post


Link to post
Share on other sites

if (!alive sniper) then {hint "sniper is dead"};

:)

exclam is part of the condition and must be inside the brackerts

Share this post


Link to post
Share on other sites
if (!alive sniper) then {hint "sniper is dead"};

:)

exclam is part of the condition and must be inside the brackerts

I don't think it MUST be there.

Share this post


Link to post
Share on other sites

Isn't it because (alive sniper) returns true, so you're basically saying {if !(true)}. Which is entirely different than saying {if (alive sniper != true)}, aka (!alive sniper)

edit: Though I am totally forgetting that if he is dead then it would be {if !(false)}. However I'm not sure that that achieves anything either.

Share this post


Link to post
Share on other sites

at the moment the line is run it will evaluate. maybe your not checking at the correct point in time.

e.g your only running the condition query once.

Try this instead

waituntil {sleep 1; ! alive Sniper};

hint "Sniper is dead";

Try to work through this debugging tutorial. It will help you to solve these problems

Zeu Debugging Tutorial

Share this post


Link to post
Share on other sites

if it's in a trigger, you put this in the condition line :

"!alive sniper"

and this in the action line :

"hint: the sniper is dead"

Share this post


Link to post
Share on other sites

If you have just one condition:

!alive sniper1

If you have more than one:

!(alive sniper1) AND !(alive sniper2)

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  

×