Can i make a local script that detects what a other player says? Like, run (Script) when you detect (Other player's message)
COMMUNITY QUESTION
Can i make a local script that detects what a other player says?
1 answer
Sure, just connect Chatted to other players, except in a localscript. You will have to account for already existing players tho, instead of just connecting to PlayerAdded.
local function Chatted(plr, msg)
print(plr,"said",msg)
end
local function PlrAdded(plr)
plr.Chatted:Connect(function(msg)
Chatted(plr msg)
end)
end
game.Players.PlayerAdded:Connect(PlrAdded)
for i,v in pairs(game.Players:GetPlayers()) do
PlrAdded(v)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
How can i make it run something when a specific player says a specific message?