GetPlayerStatLimits
Jump to navigation
Jump to search
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.