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

Help on this onChatted script?

How would you detect if a player has said "hello" in a message (onChatted) , even if the message isn't only "hello" and is somthing more like "hello friend" without actually doing somthing like if message == "hello friend" then, ect..

1 comment

0

Um, why doesn't anyone answer me question. I asked this 30 minutes ago and I have not yet gotten an answer. I thought this was Scripting Helpers, Scripting ignore-rs. Answer my question already.

1 answer

You'd use string.find, a way to find if a selection is in a string.

player.Chatted:connect(function(chat)
if chat:find("hello") then
-- do stuff
end
end)

Look up strings on the ROBLOX wiki for a whole load of more useful string related functions

1 comment

0

I would use 'string.find(chat,"hello")

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