Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I see who chatted a message?

Asked by 3 years ago

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

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
3 years ago
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)
0
How would I get the player's name? BizzareBazaar 22 — 3y
0
Player.Name rabbi99 714 — 3y
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. brokenVectors 525 — 3y
0
shut up idc iuclds 720 — 3y
0
so for the admin commands i should replace the 'if msg:lower()' to my commands script? BizzareBazaar 22 — 3y
Ad

Answer this question