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
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
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)
Please note: deprecated does not means that it does not work. It’s just old and replaced by something else. Still functions normally tho.
Deprecated code can cause problems, just so you know.
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.
5 comments
Is this in a Script or a LocalScript? Is it anywhere other than Workspace or ServerScriptService?
Because it’s using deprecated code. Let me rewrite it.
i recommend that "say:" should be "says:".
it makes grammatical sense that way
it would display: ["xJathur95x says: "..msg]. Does that make sense?