killjoy73au -> RE: LUA - Detect if multiple units have been damaged or destroyed (1/21/2018 10:10:26 AM)
|
Thanks very much for reply, I'm looking more to call a script to check if specific units still exist. I tried this script that gets called every 15 seconds by a trigger... if ScenEdit_GetUnit({side="PLAAF", unitname="Anshan DD-101"}) == nil then ScenEdit_SpecialMessage('United States Navy','Anshan Destroyed') ScenEdit_SetEvent('PLAN SAG - Destroyed', {IsActive= false}) end I got this working. Now what i'm looking to do is have this script check for multiple different units, resulting in just the one msg. Okay I got it working. Once both units are destroyed the message pops up and the trigger/event stop checking. It doesn't look overly professional but it works damnit! if ScenEdit_GetUnit({side="PLAN", unitname="Anshan DD-101"}) == nil and ScenEdit_GetUnit({side="PLAN", unitname="Changchun DD-103"}) == nil then ScenEdit_SpecialMessage('United States Navy','Anshan and Changchun Destroyed') ScenEdit_SetEvent('PLAN SAG - Destroyed', {IsActive= false}) end
|
|
|
|