Help finishing some server events?

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? :slight_smile:

How about you tell us what you donโ€™t uderstand? :slight_smile:

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