I've already got the code, how do I make multiples as a number?
1 | workspace.Rounds:GetPropertyChangedSignal( "Value" ):Connect( function () |
2 | if workspace.Rounds.Value = = 10 20 30 40 50 then |
3 |
4 | end |
5 | end ) |
You can use the % operator
in lua which gets the remainder after divison. So in your usecase, any number that is a multiple of 10 will pass.
1 | workspace.Rounds:GetPropertyChangedSignal( "Value" ):Connect( function () |
2 | if workspace.Rounds.Value % 10 = = 0 then |
3 | -- Rest of code. |
4 | end |
5 | end ) |
In order to see if a number is a multiple of ten, you'd want to divide that number by ten to see if it comes out as a whole number. Change your script to this:
1 | workspace.Rounds:GetPropertyChangedSignal( "Value" ):Connect( function () |
2 | num = workspace.Rounds.Value/ 10 |
3 | if num = = math.floor(num) |
4 |
5 | end |
6 | end ) |
math.floor
rounds the number down. So if a number is the same as itself floored, then it is a whole number because it never had to be rounded. I hope this helps!