So I was making a trader to sell Swords and I made a gui for it which the gui has a script where if you touch a circle in the map it makes the gui visible which works then later I made a button so it would close the gui but when you press it it works but later when you try to open the gui again using the button it doesnt work here are the codes I dont know how to fix this could anybody show me what is wrong or tell me how to fix it.
--- This is the Button For it to close.
function click()
if script.Parent.Parent.Visible == true then
script.Parent.Parent.Visible = false
else script.Parent.Parent.Visible = true
end
end
script.Parent.MouseButton1Click:connect(click)
---- Touch Script For the Circle Object
function touch(hit)
if game.Players:findFirstChild(hit.Parent.Name) ~= nil then
local player = game.Players[hit.Parent.Name]
if player.PlayerGui:findFirstChild("Info") == nil then
local gui = script.Info:clone()
gui.Parent = player.PlayerGui
repeat
wait()
until (player.Character.Torso.Position - script.Parent.Position).magnitude > 5
gui:remove()
end
end
end
script.Parent.Touched:connect(touch)

3 comments
Yeah thanks it was fixed.
what fixed it?
just nvm atleast it is fixed