OsSetHealth

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page for new OSSL function)
 
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=High
 
|threat_level=High
|function_syntax=float osSetHealth(string avatar, float health)
+
|function_syntax=void osSetHealth(string avatar, float health)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
default
 
default

Revision as of 21:48, 23 October 2017

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

See also osGetHealth, OsCauseDamage, OsCauseHealing.

Threat Level High
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
default
{
    touch(integer t)
    {
        key agentID = llDetectedKey(0);
        osSetHealth(agentID, 50);
        llSay(0, llKey2Name(agentID) + " has " + (string)osGetHealth(agentID) + "% health left.");
    }
}
Personal tools
General
About This Wiki