Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Help on this onChatted script?

Asked by
Kahnu 5
9 years ago

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..

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. Kahnu 5 — 9y

1 answer

Log in to vote
1
Answered by
Jonibus 30
9 years ago

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

0
I would use 'string.find(chat,"hello") Shawnyg 4330 — 9y
Ad

Answer this question