So I have a shop GUI where if the player touches the part, a GUI will pop up and when the GUI is closed and I touch the button again, the GUI doesnt show up now, what's going on? You can also provide an explanation because I have no idea what filtering enabled is if that is the solution. Thanks!
EDIT (SOLUTION) : DONT USE LOCAL SCRIPT, USE A NORMAL SCRIPT
Part script :
button = script.Parent
function onTouch(part)
if part.Parent:FindFirstChild("Humanoid") ~= nil then
local player = Game.Players:GetPlayerFromCharacter(part.Parent)
if player ~= nil then
local GUI = Game.ReplicatedStorage:FindFirstChild(script.Parent.ShopGUI.Value)
local AlreadyHaveGUI = player.PlayerGui:FindFirstChild(script.Parent.ShopGUI.Value)
if AlreadyHaveGUI == nil then
GUI:Clone().Parent = player.PlayerGui
else print("Already have GUI!")
end
end
else print("Humanoid not found!")
end
end
button.Touched:connect(onTouch)
Close script :
function close()
game.Players.LocalPlayer.PlayerGui.ArmorShopGUI2:Remove()
end
script.Parent.MouseButton1Click:connect(close)

3 comments
I tried using the code but it still only works once, where if I try again it will always print "Already have GUI!", any ideas? Thanks for your answer.
Oh I know what is wrong, I was using a LocalScript instead of a normal Script, thanks anyways!
Ahh lol yeah that'll do it. No problem.