Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
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 

3 comments

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.

0

Oh nevermind. I had to add a parenthesis to the end of the function. Thank you for the answer!

0

np

This discussion is preserved as it was. New answers, comments, and votes are closed.