Not too sure but, I’m pretty sure “source” only exists for events. If you want it to work in functions, you’re going to have to pass it.
AddEventHandler('entreprise:recupinfos', function()
Testing(source) -- OK
print('Testing lancé') -- OK
end)
function Testing(source)
--- code here
-- source now exists in the function "Testing"
end
Edit: Also, wrong section. Please try and post in the correct category next time
Yea, I’ve updated the snippet as I forgot to add “source” as a parameter for the function…
Edit: It could be because you have like two events inside of each other and, because of the asynchronous nature of events, the “source” variable is being released from memory…
Edit 2: Have you tried just triggering the event from the server event? E.g.
AddEventHandler('entreprise:recupinfos', function()
TriggerClientEvent("event", source)
print('Testing lancé') -- OK
end)