Good way to display "welcome message"

Hallo there, i try to working on a basic “welcome message” for a fivem server.
I actually got a welcome message:

My code looks like this

AddEventHandler("playerSpawned", function(spawn)
    GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), 10000, false, false)
    SetAmmoInClip(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"),999)

    helpText("~b~Welcome ~g~".. GetPlayerName(soruce) .. " ~b~to ...........")
end)    

function helpText(string)
    SetTextComponentFormat("STRING")
    AddTextComponentString(string)
    DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end

But this welcome message is triggered every time the player dies or he repawns.
Is there a way or soloution to a achieve this.

EDIT

The displayed code is a client script.

greetings from praktii.

Add a boolean for “firstSpawn”

if firstSpawn then
    // show the text
    firstSpawn = false
end
1 Like

Oh yeay i did not thinked that far.
Thanks for your quick reply.

i think this is the first topic that someone has blocked out their server name when sharing a in-game screenshot. Noice

2 Likes

I am looking for the name of this source to find it inside the sources and edit it. Does anyone know what the name of this source is?