Squirrel/Client/Functions/Players/Health

From Liberty Unleashed Wiki
Jump to: navigation, search

Contents

Syntax

  1. float player.Health
  1. player.Health = float value

Arguments

  • value - What you can set the health value to.

Example

  1.  
  2. pPlayer <- FindLocalPlayer();
  3.  
  4. function onClientCommand( cmd, text )
  5. {
  6. if ( cmd == "health" )
  7. {
  8. pPlayer.Health = 100;
  9. Message( "[#00ff00]*System* [#ff0000]Your health is " + pPlayer.Health + ".");
  10. }
  11. }
  12.  

This will heal the player when He use /health.

Notes

The call onClientCommand and Message were used in in this example. More info about them in the corresponding page.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox