Skip to main content
Client Part of Inventory.

Client

The player’s own inventory, sent by the server to that player only. Reads are local:
Actions ask the server, which checks everything again. They MUST run in a thread and return ok, errorCode:
Give needs the other player within giveDistance meters, measured on the server. The other inventory:
from and to are 'player' or 'other'.

Build an inventory UI

client.lua
On clients, Changed gets (changes, ref): nil after a full sync, or the list of changed slots. Opened gets the opened inventory and Closed nothing.

Security

Clients send slots and counts, never items, metadata or inventory ids. Their own inventory is player, the open one other. Each replies true or an error code. The client functions above call them for you.