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)