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

How do you make a Frame visible from a TextButton/ImageButton?

Asked by 5 years ago

I'm currently trying to make a computer and one of the apps should open another frame to an error. I've been testing with different scripts and put multiple responses to other questions related and the script still doesn't work. Here is the code I used for my script:

repeat wait() until game.Players.LocalPlayer~=nil

script.Parent.MouseButton1Click:connect(function(Clicked)
    local player = game.Players:GetPlayerFromCharacter(Clicked)

    local errorframe = game.StarterGui.ComputerGui.ComputerFrame:WaitForChild("ErrorFrame")
    player:WaitForChild("StarterGui").ComputerGui.ComputerFrame:WaitForChild("ErrorFrame").Visible = true
end)

1 answer

Log in to vote
0
Answered by
chafava -113
5 years ago
Pretty simple really, here is the simplified version:

script.Parent.MouseButton1Down:connect(function()
     script.Parent.Parent.Frame.Visible = true
     --  ? Lets assume this is the frame's location
end 
0
The frame I'm trying to make visible is still not showing up/becoming visible. I changed the 4th line to the correct location and it still doesn't work. DankterPepper 18 — 5y
0
Oh nevermind. I had to add a parenthesis to the end of the function. Thank you for the answer! DankterPepper 18 — 5y
0
np chafava -113 — 5y
Ad

Answer this question