Hello everyone,
I have made a script (with a little help of youtube) where you can set a text and the next time you join you see that text in the chat but, i get a error that i can’t fix it has to do with getting the license identifier on line 18.
Please help
Assuming that is a server-side code.
When executing a command on the server console, the source returns 0, so you need to register the command content in an event and trigger it on the client-side command
example:
server:
RegisterNetEvent("welcomeText", function(text)
local player = source
-- Do something with the text and source
end)
client:
RegisterCommand("welcomeText", function(_, args)
local text = args[1]
TriggerServerEvent("welcomeText", text)
end)
The error message says the first parameter (in your case source) of the serverside function is null. It is because on the clientside you trigger welkom:show without any parameter.
Just remove the source parameter of your serverside welkom:show function and then it should work!
Alternatively you can keep the source parameter and trigger the welkom:show event as follows:
TriggerServerEvent('welkom:show', PlayerID())
This will pass the ID of the Player to your serverside ‘welkom:show’ function.