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

How do i use Chatted event of Player ?

I used the exemple in wiki but what i tried is...

game.Players.PlayerAdded:connect(function(plr)
    plr.Chatted:connect(function(msg)
        print(plr.Name.. "say :"..msg)
    end)
end)

It didn't print what the player say.

Thanks

5 comments

1

Is this in a Script or a LocalScript? Is it anywhere other than Workspace or ServerScriptService?

0

Because it’s using deprecated code. Let me rewrite it.

0

i recommend that "say:" should be "says:".

0

it makes grammatical sense that way

0

it would display: ["xJathur95x says: "..msg]. Does that make sense?

1 answer

✓ Accepted answer

It didn’t work because it uses deprecated code. RBXScriptSignal:connect() is deprecated, it is RBXScriptSignal:Connect(). It could also be that “Players” wasn’t found inside game so it’s always good to use DataModel:GetService(Instance className).

game:GetService(”Players”).PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg, recipient)
        print(plr.Name..” said: ”..msg
    end)
end)

3 comments

0

Please note: deprecated does not means that it does not work. It’s just old and replaced by something else. Still functions normally tho.

0

Deprecated code can cause problems, just so you know.

0

It’s like trying to run Windows 10 on a Windows 95 computer.

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