Try placing the plrAdded event at the start of the function.
You are using WaitForChild() at the top, so it could be that the game loaded the player before the chat, causing the event to not detect it
The script runs after the first player is added(due to the require at the top taking time to run), therefore it wont fire the PlayerAdded event. To fix the issue, you have to create a PlayerAdded function and run it for each player currently in the game:
local Players = game:GetService("Players")
function PlayerAdded(player)
print("AAAAAAAAAAA")
end
--current players
for _, player in pairs(Players:GetPlayers()) do
PlayerAdded(player) --may want to pcall if the function can error
end
--new players being added
Players.PlayerAdded:Connect(PlayerAdded) --no reason to pcall this(assuming your code snippet can't yield)