I’m trying to make a button that closes the GUI when clicked and it closes it, but it also makes it unable to be opened again.
So the GUI is cloned from ServerStorage into a player’s PlayerGui:
SpawnGiver
script.Parent.Touched:connect(function(p) --Edit: <–That’s a p) not sure why it’s showing that weird symbol.
local player = game.Players:GetPlayerFromCharacter(p.Parent)
if (player) then
if (not player.PlayerGui:FindFirstChild(“SpawnGUI”)) then
local GUI = game:GetService(“ServerStorage”).SpawnGUI:Clone()
GUI.Regen.Value = script.Parent.Parent.Pos
GUI.Parent = player.PlayerGui
end
end
end)
This is in my script for when my button is clicked:
SpawnGUILocal
bg.X.MouseButton1Click:connect(function()
player.PlayerGui.SpawnGUI:Destroy()
end)
I want the GUI to be able to pop up again when someone touches the pad.
Thoughts?