0

How do I make a GUI open with a click detector? (With LocalScripts)

Asked by 8 months ago

I have been working on a game, and I have opened GUIs with normal scripts before. But, when I try to open a GUI with a LocalScript, it doesn't work. I am trying to find a way to make this work, but I can't. Any help?

0
Answered by 8 months ago

I knew that you can't open a GUI with a LocalScript, but I tried to do it in several ways anyway; and actually, it can't be done. But you can do it with a Script, and it will only affect the player and won't affect others (only the GUI will appear for the one who pressed ClickDetector). This is the best way to do it:

script.Parent.MouseClick:Connect(function(player)
player:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = true
--Reminder: Change the names and locations to the ones you need
end)


It's a very simple stuff. Let me know if this answer helped you :D

0
Thank you so much! This really helped! I have been looking everywhere for this. (Sorry for the late response. I was offline for a long time.) JackyW9cky 18 — 8mo
0
Thank you so much! This really helped! I have been looking everywhere for this. (Sorry for the late response. I was offline for a long time.) JackyW9cky 18 — 8mo