So, I have this "ShopGUI" script, when someone goes into the store they hit an invisible brick, and a GUI pops up. However, when they leave the store (no longer touching part), I want the GUI to disappear. How would I do this?
Here's my script
script.Parent.Touched:connect(function(touchy)
local player = game.Players:GetPlayerFromCharacter(touchy.Parent)
if player then
if player.PlayerGui:FindFirstChild('StoreGUI') == nil then
local shopGUI = game.ServerStorage.StoreGUI:Clone()
shopGUI.Parent = player.PlayerGui
end
end
end)

1 comment
use the TouchEnded function....