Reads or changes the player's health.
| Name | Type | Description |
|---|---|---|
value | number | New health value for setHealth. Automatically clamped to 0..20. |
p:health() returns the current health as a number. p:setHealth() returns nothing.
command('heal', { op = true }, function(sender)
if not sender.isPlayer then return true end
sender:setHealth(20)
sender:send(color.green .. "Health restored.")
return true
end)