Script below is inside a chracter from workspace to open the gui from the player
local Clicker = script.Parent:WaitForChild("Clicker")
local TeamAllowed = {
["Woo"] = true,
}
Clicker.ClickDetector.MouseClick:Connect(function(plr)
if TeamAllowed[plr.Team.Name] then
plr.PlayerGui.TeamShopTESTING.Main.Visible = true
print("Working!!")
end
end)
I click on it and the gui pops up after i close it by turning the frame Visible = false with a localscript from the Exit part of the gui, The Detector doesn't work again and i can't open the gui. I want to be able to open the gui again na inf amount of times but it just doesn't work.
I'm fairly new to scripting and i need some help.

2 comments
The detector script is on a character after you click him it opens the gui from the player
Formatted the code