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

Text not changing accordingly to if statement with number generator?

Asked by 3 years ago

This question has been solved by the original poster.

Hello, so I am making a disaster game. I want to make a gui that shows the disasters. To do this I was planning to connect it to the number generator that generates the disasters and make it change text accordingly, but it seems to not work. Any help? Minigamevalue is the number generated. So far only have the two disasters.

function disasterUpdate()
    if minigamevalue == 1  then
        disaster.Text = "Lava"
    elseif minigamevalue == 2 then
        disaster.Text = "Flash Flood"
    end
end
disasterUpdate()

minigamevalue.Changed:Connect(disasterUpdate)
0
You forgot to add ".Value". It should be `minigamevalue.Value`. I don't know what your entire script looks like so I am going to guess that your variable looks somewhat like this. `local minigamevalue = Minigame.Value` If it does, remove '.Value' and add it only to the name of the variable. CMVProduction 25 — 3y
0
Oh wow thank you so much WorriedClocks 0 — 3y

Answer this question