Detect when a player says a certain thing

Seems like a dumb question, right? Well, im bad at scripting so im not sure how to do this. Any help is appreciated, thanks!

Next time google first, anyways:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		if Message == "My Message" then
			print(Player.Name.." said My Message")
		else
			print(Player.Name.." didn't say My Message, but said: "..Message)
		end
	end)
end)
1 Like

I did, and i cant access yt or anything else not roblox related so what can i do lol. Thank you for your help.

You should mark @domboss37’s script as solution unless you’re referring to something else

I am in the process of writing down his example, if it works i will.

You can just click copy next to his code

on a mobile device. So lol. Give me a minute to test this.

Oh! Sorry, I see now. That makes sense

1 Like

Thank you, it worked. Although i did not need the entire code i really appreciate it. :+1:

Sometimes people don’t have access to Google, the devforum is a much more efficient place to get answers

1 Like

By that I meant overall search google or the devforum as there are countless topics on this. I should have made it clearer.

1 Like

people don’t have access to Google

Who?

the devforum is a much more efficient place to get answers

You should use devforum’s search feature before creating a new thread.

its not specifically GOOGLE, its any other social platform, etc. i didnt find anything on google.

i tried searching it and didnt see anything (maybe i typed it wrong idk) so i assumed it wasnt there. next time ill dig deeper.