I recently came across this really handy practice for toggling between two values, however I don’t fully understand which quirk of Luau’s allows me to do something like this:
function ToggleText(bool:boolean)
TextLabel.Text = bool and "OFF" or "ON"
end
Where I would rather have to be doing this instead:
function ToggleText(bool:boolean)
if bool then
TextLabel.Text = 'ON'
else
TextLabel.Text = 'OFF'
end