Heya Guys! I am Currently making a model to where when you click a part a GUI Becomes visible
Menu = game.StarterGui.PopUpMenu.Frame function onClicked() Menu.Visible = true end script.Parent.ClickDetector.MouseClick:connect(onClicked)
For some reason it didnt become visible. While I was testing in character on studio, I scrolled down its Properties and it read Visible. Any help?
Your problem is that your setting the gui in StarterGui visible. You need to set the gui in the player to visible.
function onClicked(player) player.PlayerGui.Menu.Visible = true end script.Parent.ClickDetector.MouseClick:connect(onClicked)
This should work. Let me know if it doesn't.
StarterGui is where gui's are cloned from, into the player. If you respawn, you will see the changes made. Instead, you need to access the player's PlayerGui. I recommend changing your script to a LocalScript, then making it's code as follows:
local player = game.Players.LocalPlayer local menu = player.PlayerGui:WaitForChild("PopUpMenu").Frame script.Parent.ClickDetector.MouseClick:connect(function() -- shorter way of doing functions menu.Visible = true end)