STiT 0 Posted October 6, 2005 Please, I need help! I want to make a script that detects if a man (regardless which side he's on, which units he is, ...) get close to a certain object! Can somebody help me? Also, I already thought about using a trigger, but I need this script for a addons, therefore I shouldn't use triggers, just outside scripts! If somebody figures out something, let me know! I've spent the whole last night... If I wasn't clear enough, I'll explain again. I'm sorry, english is not my native language and I still have to learn some about it! Thanks everybody in advance! Share this post Link to post Share on other sites
hardrock 1 Posted October 6, 2005 Well, you could try the nearestObject way, but I advice you not to use it in long-lasting loops for cause of performance. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_nO = nearestObject[_unit,""] ? ((_nO countType "Man") > 0) : hint ("_nO is a man of side" + (side _nO)) Share this post Link to post Share on other sites
STiT 0 Posted October 6, 2005 I've already tried the NearestObject, but that way I would have to define the unit type! I'll try what you said, anyway. Thanks a lot! Share this post Link to post Share on other sites