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

Can i make a local script that detects what a other player says?

Can i make a local script that detects what a other player says? Like, run (Script) when you detect (Other player's message)

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

1 comment

0

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

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