GetPlayerStatLimits: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Progression Functions]] | [[Category:Progression Functions]] | ||
Latest revision as of 09:53, 15 August 2026
getPlayerStatLimits
Returns the accepted numeric range for a progression stat key.
Syntax
table getPlayerStatLimits(string statName)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
statName |
string |
yes | A key returned by getPlayerStatNames.
|
Returns
Returns a table containing minimum and maximum, or nil for an unknown stat.
Examples
Clamp a requested strength value:
local limits = getPlayerStatLimits("strength")
if limits then
local value = math.max(limits.minimum, math.min(100, limits.maximum))
setPlayerStat(playerId, "strength", value)
end
Notes
- Available only in server-side resource scripts.