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

How to make an output message if a player says a specific thing in chat?

Okay, so I tried to make the script as it follows by looking at the wiki. I honestly didn't understand much, in fact, I tried to run the script and it didn't work. What did I do wrong?

   local call = "hi"

  

local function onPlayerChatted(player, message, recipient)

if string:sub(message, 1, call:len()):lower() == call:lower() then

print("Hi")

end

end

Thank you very much if you are going to help me.

1 answer

✓ Accepted answer

So, this is basically how you do it:

game.Players.PlayerAdded:Connect(function(player)
  player.Chatted:Connect(function(msg)
      if msg == "Hi" then
		print("Sup")
	  end
  end)
end)

This can be used from the server and the client. Basically getting what the player says. Then doing stuff with it.

2 comments

0

i also have fun doing that, i also did a script like that but, well i guess the thing who sees it is the client not the server

0

ok

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