It seems they want to establish a MaxValue for their variables. But its something that is not built into Roblox itself. They need to program it themselves.
local max = 10
local min = 1
local intvalue = intvaluepath
intvalue.Changed:Connect(function()
intvalue.Value = math.clamp(intvalue.Value, min, max)
end)
Hey there, it looks like you’re trying to explain what “math.clamp” does which is what the guy above explained. All good though,
To explain a little more:
math.clamp() is a function that adds a minimum and maximum value to a variable. However, you can simply do math.clamp() with a far-down min value.
Example:
local temp = 98.6
local counter = 93
local tempMaxValue = 98.6
local counterMaxValue = 93
temp = math.clamp(temp, -9999999, tempMaxValue)
counter = math.clamp(counter, -9999999, counterMaxValue)
-- Replace -9999999 with the lower limit that you want for the variables!
For more information, you can check out the official Roblox math.clamp documentation page here: