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

When I click a part for a GUI, it works, but when I do it a second time, it doesn't. Help?

So, I'm making a click part for a gui. Here's the code.

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	player.PlayerGui.ChooseGui.Frame.Visible = true
	
end)

And, I click on it. It works completely fine. Then, I click the exit button I made, (Which makes the frame false, doesn't destroy it.) and it exits. I click on the part again, but the GUI just won't pop up again. Any help?

2 answers

✓ Accepted answer

Well, the only reason I can think of why this wouldn't be working is if you're using this Server Script to change the frame's visibility to true, and then you're using a Local Script to change it to false. If you are doing it this way, the reason why it won't work is because on the server the frame's visibility is still set to true, where as on your client it's set to false and the server can't see that. Server Scripts can only see things on the server, not the client. You can fix this by changing your exit button script to a Server Script.

1 comment

0

Oh my god, thank you so much! :) It worked super well.

As xInfinityBear said, your only problem is most likely the difference for the client and the server. If you want to make it so only the client (player) who clicked can see the Gui or for the whole server to see then use RemoteEvents, otherwise use his solution

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