GetPlayerArmor: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Equipment state is server-authoritative and included in player synchronization. | * Equipment state is server-authoritative and included in player synchronization. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
[[Category:Equipment Functions]] | [[Category:Equipment Functions]] | ||
Latest revision as of 09:52, 15 August 2026
getPlayerArmor
Returns the stable key of the armor equipped by a player.
Syntax
string|false getPlayerArmor(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns the equipped armor key, an empty string when the slot is clear, or false for an invalid player.
Examples
Read a player's equipped armor:
local itemKey = getPlayerArmor(playerId)
if itemKey and itemKey ~= "" then
outputDebugString("Equipped armor: " .. itemKey)
end
Notes
- Available only in server-side resource scripts.
- Equipment state is server-authoritative and included in player synchronization.