Answered by
5 years ago Edited 5 years ago
Please format code properly.
This is your code right now.
02 | workspace.Rain.RainEffect.RainScript.Enabled = false |
03 | workspace.Snow.SnowEffect.SnowScript.Enabled = false |
08 | if math.random = = 1 then |
09 | workspace.Rain.RainEffect.RainScript.Enabled = true |
11 | if math.random = = 2 then |
12 | workspace.Snow.SnowEffect.SnowScript.Enabled = true |
Now there are some obvious errors, such as you are missing an end. Also, you can use else instead of making another if statement. Also, you're comparing the function math.random
to a number. Instead, you want to store the random number math.random
generates, and compare that to a number.
(I'm assuming waiting 2 minutes and 40 seconds to perform the snow check is intentional)
You probably want to do something similar to this:
02 | workspace.Rain.RainEffect.RainScript.Enabled = false |
03 | workspace.Snow.SnowEffect.SnowScript.Enabled = false |
06 | local num = math.random( 1 , 2 ) |
09 | workspace.Rain.RainEffect.RainScript.Enabled = true |
12 | workspace.Snow.SnowEffect.SnowScript.Enabled = true |
Reply with further questions,
and please mark as correct if this solution works for you!