Skip to content

SetEntityData

Stores a value on a world entity, private to the server.

Any Lua value; gone with the entity and on a reload. For a value the clients read use SetEntityState.

SetEntityData(id, key, value)
Parameter Type
id number the entity
key string the key
value any the value; nil removes the key

boolean - false when there is no such entity

local id = CreatePickup("longSwordDuel", x, y, z)
SetEntityData(id, "owner", winner)

GetEntityData · SetEntityState · SetZoneData · the Storage and persistence group of the index