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

How do you make a onChatted script, like admin commands?

I have tried to make a onChatted script however, I keep on failing. Please help me.

3 answers

Hi XMessi10,

I understand, I also had difficulty understanding how to do onChatted scripts before, so I made a simple onChatted script for you. Here ya are:

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(msg)
		if(msg == "") then
			-- do something
		end
	end)
end)

Hope this helps!

  • war8989

2 comments

0

The script example I gave is meant to check if a player says something, so if you would like to test it, add something in between the quotation marks and replace the comment with whatever you want.

0

Thanks I'll try it out.

I noticed that the tag was "LocalScripts", and these scripts must be global if you use .PlayerAdded (Pretty sure)

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