mrbean1112 0 Posted September 26, 2006 "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] how would i give him an eventhandler of being killed exec script zkilled.sqs ? Share this post Link to post Share on other sites
Chaos 0 Posted September 27, 2006 Very simple: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> BoBs addEventHandler ["hit",{_this exec "script.sqs"}] Share this post Link to post Share on other sites
mrbean1112 0 Posted September 27, 2006 Very simple:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> BoBs addEventHandler ["hit",{_this exec "script.sqs"}] thanks.. but i have the script looping, so i imagine there are many bobs being made... now... will this affect the eventhandler? Share this post Link to post Share on other sites
Chaos 0 Posted September 27, 2006 hi, look here: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop _bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] ~.5 _bob addEventHandler ["hit",{_this exec "script.sqs"}] goTo "loop" Share this post Link to post Share on other sites
korax 4 Posted September 27, 2006 hi, look here:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop _bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] ~.5 _bob addEventHandler ["hit",{_this exec "script.sqs"}] goTo "loop" That will fail. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] ~.5 BOBs addEventHandler ["Killed",{(_this select 0) exec "zkilled.sqs"}] goTo "loop" Share this post Link to post Share on other sites
mrbean1112 0 Posted September 27, 2006 hi, look here:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop _bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] ~.5 _bob addEventHandler ["hit",{_this exec "script.sqs"}] goTo "loop" That will fail. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"] ~.5 BOBs addEventHandler ["Killed",{(_this select 0) exec "zkilled.sqs"}] goTo "loop" okay.. this partially works, when i do it, basically i have a script which gives the player 25$ _victim = _this select 0 _killer = _this select 1 ?(_killer == w1):w1money = w1money + 25 ?(_killer == w2):w2money = w2money + 25 ?(_killer == w3):w3money = w3money + 25 ?(_killer == w4):w4money = w4money + 25 But now it is giving me an error about the killer. where it expects array and i give object or something like that... Share this post Link to post Share on other sites
Chaos 0 Posted September 27, 2006 That will fail. Not possible! Share this post Link to post Share on other sites
Metal Heart 0 Posted September 27, 2006 According to command reference createUnit doesn't return anything so it shouldn't work. Share this post Link to post Share on other sites