[Help] Welcome message not working

AddEventHandler('playerSpawned', function(spawn
TriggerEvent('chatMessage', 'Server', {255, 255, 255}, "Welcome!")
end)

No idea why this isn’t working.

There’s a syntax error in your script. If it’s on the client, try pressing F8 in game to show the script output console!

function(spawn

There is the syntax error.

it should read

function(spawn)

Wow I must be blind! Thank you.

Hmm. Still no message showing.

AddEventHandler('playerSpawned', function(spawn)
TriggerEvent('chatMessage', 'Server', {255, 255, 255}, "Welcome to OGDrift! Get started at www.ogdrift.pw")
end)
TriggerEvent('chatMessage', 'Server', {255, 255, 255}, "Welcome to OGDrift! Get started at www.ogdrift.pw")

From this, you are trying to send ‘Server’ a join message I believe…

try this

TriggerEvent('chatMessage', '', {255, 255, 255}, "Welcome to OGDrift! Get started at www.ogdrift.pw")

Thanks for helping. That however does not work :confused:

Got it working with this code,

AddEventHandler('playerSpawned', function(spawn)
TriggerEvent('chatMessage', 'SYSTEM', {255, 255, 255}, "Welcome to OGDrift! Get started at www.ogdrift.pw")
end)

Note that it will broadcast it every time the player respawns

1 Like

i know a little bit of lua script, but my idea is to triggering message not on spawned player,but only when player joyning.
like that:

AddEventHandler('onPlayerJoining', function(netId, name)
	TriggerEvent('chatMessage',name , {255, 255, 255}, "Welcome to bla bla bla")
end)

it’s is possible?

No, that runs before the chat is even activated for the client.

1 Like

oh,thank you,
im try to understanding scripting.sorry for mistake.

what file do i put that in