Difference between revisions of "GetLocalPlayerEntityId"

From Nomad DB
Line 2: Line 2:
  
 
== Syntax ==
 
== Syntax ==
<pre>
+
<syntaxhighlight lang="lua">
 
GetLocalPlayerEntityId()
 
GetLocalPlayerEntityId()
</pre>
+
</syntaxhighlight>
  
 
== Example ==
 
== Example ==

Revision as of 18:56, 14 April 2020

This functions return the Entity ID of the local player. Under some circumstances it's possible for the returned ID to be invalid, thus should be checked against GetInvalidEntityId.

Syntax

GetLocalPlayerEntityId()

Example

The example below checks whether the Entity ID of the local player is valid or not.

local lplayerId = GetLocalPlayerEntityId()
if lplayerId == GetInvalidEntityId() then
	print("Invalid local player")
else
	print("Got the local player ID")
end

Related Pages