I tried doing,
game.Players.PlayerAdded:connect(function(player) if player.Name == "Player" then player.Chatted:connect(function(msg)
end) end
end)
But that just detect if one player says something. I'm trying to make it so that if anyone says something it'll effect the position/transparency of a part.I already know hoe to do the second part, I just don't know how to make it detect any players chat. (I got this information from the roblox wiki)
Running a script every time someone says something specific in chat.
game.Players.PlayerAdded:connect(function(player) if player.Name == "Player" then player.Chatted:connect(function(msg) if msg:lower() == "command" then -- // Do stuff end end) end end)
Without a command and activates every time the set person chats.
game.Players.PlayerAdded:connect(function(player) if player.Name == "Player" then player.Chatted:connect(function(msg) -- // Do stuff end) end end)
why dont you just remove the part
if player.Name == "Player" then
and dont forget to remove the "end" after the "end)" belonging to player.Chatted:connect(function(msg)
(so the "end" in line 2 of the codeblock in your post)