How to run my Function when my Player chats something in the chat?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

How to run my Function when my Player chats something in the Chat?

  1. What is the issue? Include screenshots / videos if possible!

How to run my Function when my Player chats something in the Chat?

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I haven’t tried any solutions so far. I did look for solutions on the Developer Hub.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block
function StartGame()

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

You can read up on Player.Chatted. It should do what you want.

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "whatever message you want here" then -- remove this line if you just want it to be any chat ofc
			StartGame()
		end
	end)
end)
2 Likes