I’m trying to make a gui that appears when a player types /shop. The gui appears once when the player types /shop but once they exit out the gui and its removed the command no longer works again.
local MainPart = script.Parent
local GUI = game.ReplicatedStorage.CCStuff["Stadium Goods"]
local Range = 10
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Text)
if (Player.Character.HumanoidRootPart.Position - MainPart.Position).magnitude <= (Range) then
if Text == "/shop" then
if not Player.PlayerGui:FindFirstChild("Stadium Goods") then
local GUI = game.ReplicatedStorage.CCStuff["Stadium Goods"]:Clone()
GUI.Parent = Player.PlayerGui
end
end
end
end)
end)