Difference between revisions of "GetLocalPlayerEntityId"

From Nomad DB
(Created page with "This functions return the Entity Id of the local player. The returned id should be checked against the Invalid Entity Id. == Syntax == <pre> GetLocalPlayerEn...")
 
Line 1: Line 1:
This functions return the [[Lua:EntityId|Entity Id]] of the local player. The returned id should be checked against the Invalid Entity Id.
+
This functions return the [[EntityId|Entity Id]] of the local player. The returned id should be checked against the Invalid Entity Id.
  
 
== Syntax ==
 
== Syntax ==
Line 7: Line 7:
  
 
== Example ==
 
== Example ==
The example below checks to see if the [[Lua:EntityId|Entity Id]] for the player is valid.
+
The example below checks to see if the [[EntityId|Entity Id]] for the player is valid.
 
<pre>
 
<pre>
 
local lplayerId = GetLocalPlayerEntityId()
 
local lplayerId = GetLocalPlayerEntityId()
Line 18: Line 18:
  
 
== Related Pages ==
 
== Related Pages ==
* [[Lua:EntityId]]
+
* [[EntityId]]
  
 
[[Category:WD2 Lua]]
 
[[Category:WD2 Lua]]

Revision as of 17:53, 14 April 2020

This functions return the Entity Id of the local player. The returned id should be checked against the Invalid Entity Id.

Syntax

GetLocalPlayerEntityId()

Example

The example below checks to see if the Entity Id for the player is valid.

local lplayerId = GetLocalPlayerEntityId()
if lplayerId == GetInvalidEntityId() then
	print("Local Player is valid")
else
	print("Invalid Local Player")
end

Related Pages