I made a script to open guis but when I run the script for the second time in the game then the guis won't open. How do I fix it? this is my script:
part = script.parent.clicker
part.MouseClick:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
print("Opening the Gui")
print(part)
local PlayerGui = player.PlayerGui
local GuiToBeOpened = PlayerGui:WaitForChild("ssdssdsds")
local clone = game.ServerStorage.LocalScript:Clone()
clone.Parent = GuiToBeOpened["TextButton"..value]
GuiToBeOpened.TextBox.Visible = true
GuiToBeOpened.TextButton1.Visible = true
GuiToBeOpened.TextButton2.Visible = true
GuiToBeOpened.TextButton3.Visible = true
GuiToBeOpened.TextButton4.Visible = true
end
end)
When I run the script the second time the words I print are in the output area but the gui wont open. I would be grateful if you could help.

2 comments
try adding a debounce? in the beginning add a local debounce = false and under the function do: If debounce == false then debounce = true and then your code in the bottom, after your done with the code add a wait(1) debounce = false maybe that will work
Check out my answer!