I have some server events I need help finishing, I am terrible when it comes to server functions and events and passing them from client, maybe a little explanation of how it works would be nice?
How about you tell us what you donโt uderstand?
I donโt understand how to pass the arguments from client to server in the function.
https://wiki.fivem.net/wiki/TriggerServerEvent
There have to be the same amount of arguments in lines TriggerServerEvent
and AddEventHandler
. What is there not to understand?
-- Client
TriggerServerEvent('myEvent', 'Hello World!')
-- Server
RegisterServerEvent('myEvent')
AddEventHandler('myEvent', function(string)
print(string)
end)
-- Output: Hello World!
This code only passes one argument.
string - 'Hello World!'
1 Like