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

How do I see who chatted a message?

Hi,

So I'm making admin commands and I need it so when you add 'me' as a player input it will detect the person who sent the message?

Basically, how to see who sent a chat message on Roblox.

I've been trying to find out how since this morning, but my research lead to- you guessed it- no avail.

Can I have some help? For the Player.Chatted event.

-Biz

1 answer

✓ Accepted answer
local chattedconnections = {}

game.Players.PlayerAdded:Connect(function(Player)
       chattedconnections[Player.Name] = Player.Chatted:Connect(function(msg)
		if msg:lower() == '!help' then
			print('helped')
		end
	end)
end)

game.Players.PlayerRemoving:Connect(function(Player)
	if chattedconnections[Player.Name] then
		chattedconnections[Player.Name]:Disconnect()
		chattedconnections[Player.Name] = nil
	end
end)

5 comments

0

How would I get the player's name?

0

Player.Name

1

Please don't spoonfeed by just giving someone the code and providing little to no explanation. Either explain how it all works, or give the logical answer and some useful functions and let the question author try to do it.

0

shut up idc

0

so for the admin commands i should replace the 'if msg:lower()' to my commands script?

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