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

What is wrong with this Gui script?

Asked by 9 years ago

This Gui LocalScript is supposed to 1) Wait for the Step2 Gui's visibility to be changed 2) Check the text in Step1Choice 3) Make a certain Gui invisible based on what it says.

It doesn't work at all. Nothing happens, no output at all. Scripting Analysis says it should be fine, and my hierarchies are correct Here's my script:

gui = game.Players.LocalPlayer.PlayerGui.ScreenGui
Step2 = gui.Step2
Hard = Step2.Hard
Easy = Step2.Easy
step1choice = Step2.step1choice

Step2.Changed:connect(function()
    local value = Step2.Visible
if step1choice.Text == "Action & Adventure" then
    Hard.Visible = false
elseif step1choice.Text == "Building & Comedy" then
    Hard.Visible = false
elseif step1choice.Text == "Horror" then
    Easy.Visible = false
elseif step1choice.Text == "Town & RPG" then 
    Hard.Visible = false    
end

end)
1
Have you tried `print`ing something inside the Changed event to see if the Changed event is indeed firing? Have you tried `print`ing `step1choice.Text` to make sure it's exactly what you think it is? BlueTaslem 18071 — 9y
0
No I haven't.... didn't think about that. I'll try it, thanks! Antharaziia 75 — 9y

Answer this question