Need help with making a script

Hi could someone help me with this please i have done something wrong but not sure what

AddEventHandler(‘chatMessage’, function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == “/command”) then
CancelEvent()
TriggerClientEvent(“chatMessage”, -1, “”, { 255, 251, 15 }, “/showid [first name] [last name] [age] [wanted yes or no]”)
end
end)

I assume you have this event in a client file and you have an event handler. If not, you need to do that.

Then, you can add the code to show a notification.

Edit: If you just want to send a chat message, use the “chatMesssage” event.

Something like

TriggerEvent("EVENT_HERE", "Name Here", {0,0,0}, "Message Here")

There’s a lot of information available on the Wiki. There’s no notification event by default.

I have it in a client file but that is it i am sure its possible but not sure how to do it.

So could I put the event name as a native db or does it have to be a event and if it has to be event where can i get list of them?

So you mean like this or ?

AddEventHandler(“playerSpawned”, function(spawn)
TriggerEvent(“Notifaction”, “welcomnotify”, { 0, 0, 0 }, “Hello world!”)

end)

There’s a couple of events on the wiki but, you would have to look in other resources (like the chat resource) for more specific events (e.g. the “chatMessage” event).

Client Events: https://wiki.fivem.net/wiki/Client_events
Server Events: https://wiki.fivem.net/wiki/Server_events

There is no “Notifaction” event. There’s a “chatMessage” event… I think that’s what you’re after.

Im after something where when someone joins the server it has a notifaction bottom left corner like if player died that type of notifaction but gotta find right thing.

I have found something in othe peoples scripts so i just made this

AddEventHandler(“playerSpawned”, function(spawn)
notification(‘WELCOME’)

end)

function notification(msg)
SetNotificationTextEntry(“STRING”)
AddTextComponentString(msg)
DrawNotification(false, false)
end

DONT THINK IT IS GOING TO WORK BUT IS THIS AT ALL RIGHT IN ANY WAY?

This worked thanks for your help man