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

Why won't TextButton change "Visible" property of frame when clicked?

When a textbutton is clicked on I want a frame to become visible so I have this script:

local button = script.Parent
local credits = game.StarterGui.CreditGUI.Credits

button.MouseButton1Click:Connect(function(h)
	
	print("ello")
	credits.Visible = true
	
end)

And it will print "ello" when clicked, but the frame is still not visible. I've got the exact same script inside of the frame, but it's to make visible equal to false, it still prints the thing, but won't close the frame.

I tried to do this in a serverscript too, it wouldn't work.

This code is also in a local script.

Thanks ^^

2 comments

1

try it but dont put the h in the () ok?

0

The "h" doesn't matter really. I've tried but it still won't work.

1 answer

✓ Accepted answer

Item in StarterGui will be in PlayerGui. Do this.

local plr = game.Players.LocalPlayer
local credits = plr.PlayerGui.CreditGUI.Credits

1 comment

0

That works, thank you.

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