Want to check if a word is typed in the chat!

Hello so today I scripted a little script with checks if the Player types a word in the chat the Problem is when i type something similar to this word then it will do that that happens if I type the normal word!

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(message)
		if message:match("die") then
			Player.Character.Humanoid.Health = 0
		end
	end)
end)

Can you please provide an example of what happens? Can you please provide your current code?

1 Like

I hope that is good for you

Thanks :smiley:

Oh I found the error!

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(message)
		if message:match("die") then
			Player.Character.Humanoid.Health = 0
		end
	end)
end)

that was my old code but i used match now i used == now it works!

Thanks :smiley: