RegisterKeyDefinition

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

registerKeyDefinition

Available from 0.1.9. Use matching updated server and clients.

Server Lua. Part of custom keys and shared placed doors.

Syntax

item, error = registerKeyDefinition(id, options)

Parameters and behavior

id is a resource-local string; options is a table with required name and optional description, model, value, weight, maxStack. See exact limits/defaults. Ownership comes from the calling resource, never an options field. Identical registration is idempotent; conflicting metadata is rejected.

Returns

Canonical item string and empty error on success; nil and an error string on failure. No inventory is granted.

Examples and security

See Custom keys for complete registration, copy issuance, placement, persistence and callback examples. These are server functions, not client RPC endpoints. Do not forward untrusted client arguments without gameplay authorization.