GetNPCHealth: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetNPCHealth(npc)}} {{FuncParameters}} {{FuncParam|npc|__EDIT_ME__}} {{FuncReturnValue|__EDIT_ME_..."
 
Kuzkay (talk | contribs)
No edit summary
Line 6: Line 6:


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|npc|__EDIT_ME__}}
{{FuncParam|npc|NPC you want to get health of}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|NPC Health}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
function checkHealth(player, npc)
  AddPlayerChat(player, 'NPC has: ' .. GetNPCHealth(npc) .. ' health')
end
AddCommand('npchealth', checkHealth)
</syntaxhighlight>
 


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
__EDIT_ME__

Revision as of 19:53, 13 November 2019

GetNPCHealth

Type: Function
Context: Server
Introduced: v1.0

Description

__EDIT_ME__

Syntax

GetNPCHealth(npc)

Parameters

  • npc
    NPC you want to get health of

Return Value

  • NPC Health

Example

function checkHealth(player, npc)
   AddPlayerChat(player, 'NPC has: ' .. GetNPCHealth(npc) .. ' health')
end
AddCommand('npchealth', checkHealth)


See also

__EDIT_ME__