How do I check if a player with a certain playerid chatted something specific?

Title says it all.

Current Code:

local id = script.Parent.Parent.UserID

game.Players.PlayerAdded:Connect(function (player)
	player.Chatted:Connect(function(msg)
		if msg == "hello" then
print("hi")
end
end)

local id is a NumberValue

if player.UserID == id then

end
2 Likes

Would this be before or after the Player.Chatted?

Edit: wait I think its after

if msg == "hello" and player.UserID = id then
    -- your code
end

yeah it goes after the player.chatted

This works, but its player.UserId. Not player.UserID

1 Like

oh my bad i havent scripted in a while ever since school opened again

1 Like

It’s alright, school has been taking half my day away lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.