print( math.Clamp( 10, 0, 5 ) ) -- 10 is greater than 5 so returns 5print( math.Clamp( 3, 0, 5 ) ) -- 3 is greater than 0 and less than 5, so returns 3print( math.Clamp( -1, 0, 5 ) ) -- -1 is less than 0, so returns 0print( math.Clamp( 20, 50, 10 ) ) -- 20 is greater than 10 so returns 10, even though min arg is 50
Output:
53010
Example
Heals player by 10, but won't let their health go above 100.