entity:set
Also: player:set
entity:set(key: string, value: any, scope: string?)
Sets a synchronised property on the entity.
| Scope | Who receives it |
|---|---|
public |
everyone who sees the entity |
private |
only the player concerned |
server |
nobody: it never leaves the server |
Parameters#
- key (
string): name, 64 characters at most - value (
any):nil(erases), boolean, number or text of 1024 characters at most - scope (
string, optional):"public"(default),"private"or"server"
Example#
player:set("house", "Brightmoon")
player:set("money", 120, "private")
player:set("warnings", 2, "server")
Notes#
- At most 64 properties per entity; beyond that, an error is raised.
account,vipandvip.…are reserved: useplayer:wearVip.- Properties are shared between the server's scripts. This is how scripts communicate.
- Nothing is saved: they disappear with the entity.