Updating GUI after player chatted

I am working on a game and I’m trying to update the GUI after a player has chatted a certain thing.
I have created a script but it only updates it in the Explorer but it does not show up for the player. I searched for the answer but could not find one

You could just use the PlayerAdded event (Easily getting the Player that way), detect when the Player chats using Chatted which gives the Message Chatted back, and check if that message is the same as the message you want to detect:

game.Players.PlayerAdded:Connect(function(Player)
    local PlayerGui = Player:WaitForChild("PlayerGui")

    Player.Chatted:Connect(function(MessageChatted)
        if MessageChatted == "I like turtles" then
            PlayerGui.ScreenGui.Enabled = true
            print("Updated")
        end
    end)
end)
1 Like