LuaAPI.wiki
changeset 66 7586adb1eace
parent 65 efa379b5510e
child 67 eecbb1c261bb
equal deleted inserted replaced
65:efa379b5510e 66:7586adb1eace
    76 <blockquote>This function is called when a gear is damaged.
    76 <blockquote>This function is called when a gear is damaged.
    77 </blockquote>
    77 </blockquote>
    78 
    78 
    79 Example:
    79 Example:
    80 
    80 
    81 <code lang="lua">    function !onGearDamage(gear, damage)
    81 <code lang="lua">    function onGearDamage(gear, damage)
    82         if (!GetGearType(gear) == gtHedgehog) then
    82         if (!GetGearType(gear) == gtHedgehog) then
    83             -- adds a message saying, e.g. "Hoggy H took 25 points of damage"
    83             -- adds a message saying, e.g. "Hoggy H took 25 points of damage"
    84             !AddCaption(!GetHogName(gear) .. ' took ' .. damage .. ' points of damage')
    84             !AddCaption(!GetHogName(gear) .. ' took ' .. damage .. ' points of damage')
    85         end
    85         end
    86     end</code>
    86     end</code>