IntConstrainedValue
*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.
Un IntConstrainedValue viene utilizzato per memorizzare un valore che non può essere inferiore a MinValue e non può essere superiore a MaxValue.
Sommario
Proprietà
Rimuovi un valore Integer tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue. Rimpiazzato da 1> Class.IntConstrainedValue.Value1>, ma funziona ancora.
Il numero più alto che la proprietà IntConstrainedValue.Value può essere.
Il numero più basso che la proprietà IntConstrainedValue.Value può essere.
Utilizzato per mantenere un valore intero tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue .
Metodi
Eventi
Fuori quando il valore di IntConstrainedValue è cambiato.
Proprietà
ConstrainedValue
Rimuovi un valore Integer tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue. Rimpiazzato da 1> Class.IntConstrainedValue.Value1>, ma funziona ancora.
Value
Utilizzato per mantenere un valore intero tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue .
Metodi
Eventi
Changed
Fuori quando il valore di IntConstrainedValue è cambiato.
Parametri
Campioni di codice
The below example, assuming all referenced objects existed, would print the IntConstrainedValue's new value each time it's changed. In the example below it would print 2, assuming it's within IntConstrainedValue's MinValue and MaxValue range. Otherwise there will be no change.
local function valueChanged(newValue)
print(newValue)
end
workspace.IntConstrainedValue.Changed:Connect(valueChanged)
workspace.IntConstrainedValue.Value = 2