OsGetHealth

From OpenSimulator

Revision as of 19:47, 5 December 2020 by Djphil (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
float osGetHealth(key avatar)
Gets an avatars health by key and returns the value as a float.
Threat Level None
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
//
// osGetHealth Script Example
// Author: djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osGetHealth usage.");
    }
 
    touch(integer number)
    {
        key agentID = llDetectedKey(0);
        osCauseDamage(agentID, 50.0);
        llSay(PUBLIC_CHANNEL, llKey2Name(agentID) + " has " + (string)osGetHealth(agentID) + "% health left.");
    }
}
Notes
This function was added in 0.7.5-post-fixes


See Also

Personal tools
General
About This Wiki