Skip to content

GetEntityData

A value stored on an entity with SetEntityData.

GetEntityData(id, key)
Parameter Type
id number the entity
key string the key

any - the value; nil when unset or no such entity

function OnPlayerPickup(pid, id)
local owner = GetEntityData(id, "owner")
return owner == nil or owner == pid
end

SetEntityData · the Storage and persistence group of the index