Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

plr.Chatted event not working?

game.Players.PlayerAdded:connect(function(plr)
	print("Player Added!")
	plr.Chatted:connect(function(msg)
	print("Player Chatted!")
		if msg == "hi" then
			print("Hello, "..plr.Name.."!")
		end
	end)
end)

I have put this into a regular script in ServerScriptService, but nothing happens, I thought it was because of FilteringEnabled since I am working on a project that requires FE. But turning it off does nothing. I have tried putting the code into another place, nothing happens. I added the print() function on both events, but it appears that the Chatted function is not firing, Is anybody able to help me with my situation?

(By the way, this was just test code, not part of an actual project.)

1 answer

✓ Accepted answer

You are probably testing with Roblox Studio's Test Solo feature, which does not call PlayerAdded. Either loop over all players (with :GetPlayers()) and call that function along with the PlayerAdded event, or simply use Test Server instead.

1 comment

0

Thank you so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.