Add blood value||doc135497

September 20, 2022


  • The class to which the function belongs:Entity


Increases the health value of solid objects.


  • If the increased blood volume exceeds the maximum blood volume value, it will become the maximum blood volume value


Variable name type Description
hp float Increase the blood volume value, if the passed value is negative, it will reduce the blood volume

Value Returned

type Description
float Actual increase in blood volume value. The blood volume range is [0, the upper limit of blood volume], and the increase (decrease) of the blood volume beyond this range will be ignored

Code Samples

on the entity servermount script, adds 20 health to solid objects

local realAddHp = this:addHp(20)