diff -r 54e178bb6986 -r 983ec9ac63c7 LuaAPI.wiki --- a/LuaAPI.wiki Thu Mar 24 12:43:03 2011 +0000 +++ b/LuaAPI.wiki Thu Mar 24 13:03:30 2011 +0000 @@ -340,6 +340,29 @@ === !SetHealth(gearUid, health) ===
Sets the health of the specified gear. +This can be used for purposes other than killing hedgehogs. + +For example: + + * Starting the RC Plane 10 shots + * Starting Flying Saucer (gtJetpack) with only 50% fuel. + * Setting all the mines to duds. + * (And more!) + + function onGearAdd(gear) + if (!GetGearType(gear) == gtRCPlane) then + !SetHealth(gear, 10) + end + if (!GetGearType(gear) == gtJetpack) then + !SetHealth(gear, 1000) + end + if (!GetGearType(gear) == gtMine) then + !SetHealth(gear, 0) + end + end + + +
=== !SetEffect(gearUid, effect, true/false) (0.9.14 / dev) ===