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

What is wrong with my script?

Asked by 10 years ago

So, this script looks to see if the text of two textbuttons is 'Action & Adventure" and "Easy" when the frame's visible property is changed. It doesn't do anything. if both statements are true, it should make on of two GUIs visible. Help please! I cannot show output, because when I click Play Solo or Run my studio crashes, but I can tell you that the Script Analysis doesn't see anything wrong. Thanks! Here is my LocalScript

wait(1)
player = game.Players.LocalPlayer
gui = player.PlayerGui.ScreenGui
stepone = gui.step1choice
steptwo = gui.step2choice
results = gui.results
TMM = results.TMM.Visible
LD = results.TMM.Visible

results.Visible.Changed:connect(function(change)
    if stepone.Text== "Action & Adventure" then
        if steptwo.Text== "Easy" then
            num = math.random(1,2)
            if num== 1 then 
                wait(3)
                TMM = true

            else
                wait(3)
                LD = true

            end
        end
    end
end)

Answer this question