I'm making a shop where if you touch a part it enables the GUI and the X button disables. It works fine but if I try it a second time it doesn't work. Here's the code:
Part enabler (server script):
local part = script.Parent
part.Touched:Connect(function(parthit)
print("fired")
local gui = game.Players[tostring(parthit.Parent.Name)].PlayerGui:WaitForChild("TrailShopGUI")
gui.Enabled = true
end)
X button (local script):
local button = script.Parent
button.MouseButton1Click:Connect(function()
local gui = script.Parent.Parent.Parent
gui.Enabled = false
end)
Any help is appreciated!

1 comment
It works. Thank you so much!