Can anyone make a plugin that allows players to fully repair any entity with one-hit of the hammer tool?
Not area-of-effect, just the entity that the player hit.
Not area-of-effect, just the entity that the player hit.
private object OnHammerHit(BasePlayer player, HitInfo info)
{
var hitEntity = info.HitEntity as BaseCombatEntity;
if (hitEntity == null)
return null;
if (hitEntity.health != hitEntity.MaxHealth())
{
PrintToChat($"Setting {hitEntity.health} to {hitEntity.MaxHealth()}");
hitEntity.health = hitEntity.MaxHealth();
}
return false;
} Ryz0rI have the plugin done and will post it later.
Ultra, that plugin won't take the full repair cost in to affect.
More detail please. I tested that and it was working fine. I supposed it shoud work with 0 repair cost