--- 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 @@
=== <tt>!SetHealth(gearUid, health)</tt> ===
<blockquote>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!)
+
+<code lang="lua"> 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</code>
+
+
+
</blockquote>
=== <tt>!SetEffect(gearUid, effect, true/false)</tt> (0.9.14 / dev) ===