I am trying to make a simple gui menu. When a proximity prompt in a part is triggered, it shows the gui. This works. However, whenever I make the gui invisible, the proximity prompt script will not make it appear again. The code is so simple that I don’t know what to try.
script.parent.ProximityPrompt.Triggered:Connect(function(player)
for _, button in ipairs(player.PlayerGui.Main.Shop:GetChildren()) do
button.Visible=true
end
end)
The code makes the gui visible only once, and never again after that.
“However, whenever I remove the gui”
is your local script a child of the gui? Cause if so, deleting the gui would mean you’d delete the script.
If not, you might be moving the localscript to a place where they cannot run, I’d recommend checking the devhub page on localscripts to see where they can run.
I know, but if I remember correctly, I fixed something similar through a localscript, and I suggested you to put it in StarterPlayerScripts because localscripts cannot run in the workspace.
That worked. I fired a RemoteEvent to the player in startercharacterscripts to show the gui. It now shows up after I close the gui and open it again. Thank you.