Hello,
I am making a gui so that when an admin says something, a gui will popup for them.
It works the first time, but when I close the gui and open it again, it doesn’t open.
local admins = {"ChickenCrat"}
function onChatted(msg, recipient, speaker)
msg = string.lower(msg)
if (msg == ";admin") then
if table.find(admins,speaker.Name) then
game.Players[speaker.Name].PlayerGui.adminUtils.Background.Visible = true
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:Connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.PlayerAdded:Connect(onPlayerEntered)
It should open the background frame everytime when the visible property is false, but it only works once and not again. I’m not too familiar with chat functions.
Inside the gui there is an exit button which just makes the background visible = false.
Thanks for reading,
ChickenCrat