Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
NumberRange
The NumberRange represents a range of numbers.
NumberRange stores its NumberRange.Min and NumberRange.Max values as 32-bit floating-point numbers. Very large numbers or numbers requiring high decimal precision may lose accuracy.
Constructors
| Name | Type / Returns | Description |
|---|---|---|
| NumberRange.new | Returns a new NumberRange with the minimum and maximum set to the value. | |
| NumberRange.new | Returns a new NumberRange with the provided minimum and maximum. |
NumberRange.new
Returns a new NumberRange with the minimum and maximum set to the value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| value | number | The number that both the minimum and maximum of the range are set to. |
NumberRange.new
Returns a new NumberRange with the provided minimum and maximum. The minimum must be less than or equal to maximum.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| minimum | number | The lower bound of the range. | |
| maximum | number | The upper bound of the range. |
Properties
| Name | Type / Returns | Description |
|---|---|---|
| NumberRange.Min | number | The minimum value of the NumberRange. |
| NumberRange.Max | number | The maximum value of the NumberRange. |
NumberRange.Min
The minimum value of the NumberRange, always less than or equal to the maximum.
| Field | Value |
|---|---|
| type | number |
NumberRange.Max
The maximum value of the NumberRange, always greater than or equal to the minimum.
| Field | Value |
|---|---|
| type | number |