Can't use PlayerChatted?

Hey there, so I just ran into a ‘security’ problem for PlayerChatted?

image

Here’s the code in question:

local players = game:GetService("Players")

players.PlayerChatted:Connect(function(chattype, player, msg, target)
	
	print(msg)
	
end)

Quite bizarre to me as I made an intercom system awhile back with a chatlog function that used playerchatted without issue. Is there something I’m missing here? Thanks in advanced.

You need to add the Chatted event inside a PlayerAdded event:

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        print(message)
    end)
end)
1 Like

What a simple solution, and such a dumb mistake to make. Thanks a ton lol.

3 AM Coding be like>