OsSetHealth

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Added note stating which version of OpenSim introduced this function)
Line 3: Line 3:
 
|permissions=${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
 
|permissions=${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
 
|delay=0
 
|delay=0
|function_syntax=void osSetHealth(string avatar, float health)
+
|function_syntax=void osSetHealth(key avatar, float health)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
default
 
default

Revision as of 11:51, 14 November 2018

void osSetHealth(key avatar, float health)
Sets an avatars health by key to the specified float value.

See also osGetHealth, OsCauseDamage, OsCauseHealing.

Threat Level High
Permissions ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
default
{
    touch(integer t)
    {
        key agentID = llDetectedKey(0);
        osSetHealth(agentID, 50);
        llSay(0, llKey2Name(agentID) + " has " + (string)osGetHealth(agentID) + "% health left.");
    }
}
Notes
This function was added in 0.9.0-post-fixes
Personal tools
General
About This Wiki