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

Why doesn't this GUI script work? [SOLVED]

Asked by 9 years ago

EDIT: I just figured it out, one of my other scripts had a problem that was causing this one to not run properly. I fixed it, no need to answer/comment on this question any more, although I will leave it open because, idk, why not? So, this GUI needs to look at the text of two textlabels, and based on the text make a GUI visible. All my hierarchies are correct, and I cannot provide the output because when I click Play Solo my studio crashes for whatever reason. Here is my LocalScript:

wait(1)
player = game.Players.LocalPlayer
gui = player.PlayerGui.ScreenGui
results = gui.results
stepone = results.steponechoice
steptwo = results.steptwochoice
TMM = results.TMM
LD = results.LD
AFSS = results.AFSS
AR = results.AR
NDS = results.NDS
TQ = results.TQ
SBS = results.SBS
S = results.S
WTRB = results.WTRB
PIR = results.PIR
HITW = results.HITW
DI = results.DI
BB2 = results.BB2
Loading = results.Loading

local data = {}

local action = {}
action.Easy = {TMM, LD}
action.Medium = {AR, AFSS, NDS, TQ}
data["Action & Adventure"] = action

local building = {}
building.Easy = {SBS, S, WTRB, PIR, HITW, DI, BB2}
data["Building & Comedy"] = building

results.Changed:connect(function()
    local value = results.Visible
    wait(1)
    Loading.Visible = true
    local options = data[stepone.Text][steptwo.Text]
    local num = math.random(#options)
    options[num].Visible = true
    Loading.Visible = false
end)

Also, this script was made partly by BlueTaslem, partial credit goes to him, even if it doesn't work.

Answer this question