GetEntityPosition

From Nomad DB
Revision as of 17:55, 14 April 2020 by Jan (talk | contribs) (Created page with "Retrieves a position from an Entity. == Syntax == <pre> GetEntityPosition(EntityId, index) </pre> * EntityId * '''index''' (number) 0 for x, 1 for y, 2 for z == Exa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Retrieves a position from an Entity.

Syntax

GetEntityPosition(EntityId, index)
  • EntityId
  • index (number) 0 for x, 1 for y, 2 for z

Example

local lplayerId = GetLocalPlayerEntityId()
if lplayerId ~= GetInvalidEntityId() then
	local x = GetEntityPosition(lplayerId, 0)
	local y = GetEntityPosition(lplayerId, 0)
	local z = GetEntityPosition(lplayerId, 0)
	
	print("Position: ", x, y, z)
end

Related Pages