[Help] Chat message only showing up on one client

Hi, I would need help to print a message in chat only for the client who typed a command.

This is what I got so far:

 AddEventHandler('chatMessage', function(source, name, msg)
sm = stringsplit(msg, " ");
if sm[1] == "/showid" then
	CancelEvent()
	if sm[2] == nil then 
		TriggerClientEvent('chatMessage', -1, "^*^1Example^7: /showid [First Name] [Surname]", {255, 255, 255})
	elseif sm[3] == nil then 
		TriggerClientEvent('chatMessage', -1, "^*^1Example^7: /showid [First Name] [Surname]", {255,255,225})
	elseif sm[4] == nil then 
		firstname = sm[2]
		lastname = sm[3]
			TriggerClientEvent('chatMessage', -1,"^3^*[^7" .. name .. "^3] ^3ID ^7-^3 First Name:^7 " .. firstname .. " ^3Surname:^7 " .. lastname, {255,255,255})
	else
		firstname = sm[2]
		lastname = sm[3]
		age = sm[4]
			TriggerClientEvent('chatMessage', -1,"^3^*[^7" .. name .. "^3] ^3ID ^7-^3 First Name:^7 " .. firstname .. " ^3Surname:^7 " .. lastname .. " ^3Age:^7 " ..age, {255,255,255})
		end	
	end
end)

I realized that the Example text prints it for everyone not just for the client, I am new to lua so please keep the comments easy to understand. Thanks!

All you have to do is change where you have -1 and change it to source so it would look something like
‘chatMessage’, source, “Stuff” and that will make it only show for the person that typed it. -1 means that it goes to everyone on the server

1 Like

Thanks alot guys!!
((20 Char)))

Please Don’t make multiple topics of the same thing…