Author Topic: Auto-use items  (Read 821 times)

How can i make a item that i run over with my minifig auto use, for instance a health kit.

use onPickup, check MCEs Teleports for example.

function HealthKit::onPickup(%this,%obj,%amount)
{
 if(%obj.getClassName $= "Player" && %obj.getState() !$= "Dead")
 {
  %obj.setDamageLevel(%obj.getDamageLevel() - 25);
  commandtoclient(%obj.client,'centerprint',"\c5Restored \c325\c5 HP");
  %this.delete();
 }
}