Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I can't seem to figure out why my math.random script is not working?

Asked by 5 years ago
01local module = require(script.Parent:WaitForChild("ModuleScript"))
02local gui = game.StarterGui.ScreenGui.Clicks10
03 
04 
05script.Parent.Activated:Connect(function()
06 
07    module.click1()
08 
09    script.Parent.Visible = false
10 
11local x = math.random(10)
12 
13if x == 1 then gui.a1.Visible = true else
14    if x == 2 then gui.a2.Visible = true else
15        if x == 3 then gui.a3.Visible = true else
View all 34 lines...

I'm trying to make one gui appear after clicking another, but I can't seem to make another one appear. the first one just disappears and a second one does not become visible. Any ideas?

1
If you want to change the look of a gui in the middle of the game, use PlayerGui not StarterGui Sulu710 142 — 5y
1
I think you would have to use local x = math.random(0,10) --minimum value is 0 and max is 10. SitaruDaniel 44 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

"I think you would have to use local x = math.random(0,10) --minimum value is 0 and max is 10."

SitaruDaniel is correct here.

Ad

Answer this question