So, I've been trying to make a computer model in my game that opens up a gui when you click the screen. It's semi-working; I can open it but when I close it and try to open it up again, nothing happens. I'm new to scripting, so it's probably something small I'm missing, but I'm not completely sure what to add to make it continuous? ;3;
Opening screengui code:
function Clicked(Plr)
Plr.PlayerGui.GamePasses.Frame.Visible = true
end
script.Parent.MouseClick:connect(Clicked)
Close button code (in case this is the problem?)
button = script.Parent
window = script.Parent.Parent.Parent
function onClicked(GUI)
window:remove()
end
script.Parent.MouseButton1Click:connect(onClicked)

2 comments
@LeanXeno gaaaah thank youu! Sorry my brain had a bruh moment; I've been at this for hours.
Accept the question please. Another thing is that Remove is deprecated and you should use Destroy() or AddItem() ( using debris service )