philc Posted June 23, 2015 Posted June 23, 2015 I'm trying to display a units health via a message to the user. Here's what I got:: local unt = Unit.getLife0("uArmor") trigger.action.outText("Armor Health:" .. unt, 10)
Grimes Posted June 23, 2015 Posted June 23, 2015 getLife0 returns the initial life of the unit not the current life like Unit.getLife() does. local tank = Unit.getByName('tank1') local life = tank:getLife()/tank:getLife0() trigger.action.outText('Armor Health: " .. life, 10) 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
philc Posted June 23, 2015 Author Posted June 23, 2015 That worked perfectly. Thank you very much. Small syntax correction below on the last line changing " to '. local tank = Unit.getByName('tank1') local life = tank:getLife()/tank:getLife0() trigger.action.outText('Armor Health: ' .. life, 10)
Recommended Posts