It doesn't look like I'm getting an error, I just want a script where when you say "hello" it will give you back your name. I've taken this directly from the wiki, and tweaked it a bit. Anyone see the problem? I just don't. Thanks!
function onChatted(msg, recipient, speaker) msg = string.lower(msg) if msg == "hello" then print(speaker.Name) end end
Hi bloxxyz,
Your function doesn't work because you didn't tell the system to 'fire' the function upon doing something.
You can do this by using the .Chatted script signal by doing something like this:
game.Players.LocalPlayer.Chatted:connect(OnChatted)
If I helped you, Please consider accepting the answer! Thanks!