No categories assigned

LUA:SetHP

Revision as of 22:58, 11 September 2013 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: SetHP() = Sets the given spawns HP to the given value ==== Syntax ==== SetHP(param1, param2) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''param2''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: SetHP()

Sets the given spawns HP to the given value


Syntax

SetHP(param1, param2)


Parameters

Required - param1 (Spawn), param2 (sint32)
param1 is the spawn who's HP we want to set
param2 is the value we want to set the HP to


Usage

function hailed(NPC, Spawn)
    local hp = GetMaxHP(Spawn) * 0.5
    SetHP(Spawn, hp)
end

When the NPC is hailed the players HP will be set to 50%