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 mai inferiore a MinValue e non può essere mai superiore a MaxValue.
Sommario
Proprietà
Tieni un valore Integer tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue. Rimpiazzato da IntConstrainedValue.Value, ma ancora funzionale.
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
Sparato ogni volta che viene modificato il Valore di IntConstrainedValue.
Proprietà
ConstrainedValue
Tieni un valore Integer tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue. Rimpiazzato da IntConstrainedValue.Value, ma ancora funzionale.
Value
Utilizzato per mantenere un valore intero tra IntConstrainedValue.MinValue e IntConstrainedValue.MaxValue .
Metodi
Eventi
Changed
Sparato ogni volta che viene modificato il Valore di IntConstrainedValue.
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