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

How do I make a frame visible when a string is entered?

Asked by 8 years ago

Okay so how do I make it so when a string is put in a TextBox, it makes frame visible (and no matter what the capitalization is like)?

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

I haven't really worked with textboxes, but I assume it would look something like this:

function show()
    if string.lower(textbox.Text) == string.lower("StRIng") then
        Frame.Visible = true
    end
end

textbox.Changed:connect(show)

EDIT: To make the other frames not visible, loop through (with a check that it isn't the frame you just make visible) and hide them.

function show()
    if string.lower(textbox.Text) == string.lower("StRIng") then
            for i, v in pairs(Frame.Parent:GetChildren()) do
                if v.Name ~= "Frame" and v:IsA("Frame") then -- Or whatever your frame is called.
                    v.Visible = false
                end
            end
        Frame.Visible = true
    end
end

textbox.Changed:connect(show)
0
Okay so now how do I make any other frames in that folder not visible. SchonATL 15 — 8y
Ad

Answer this question