Script help!

Hello, i need to get a answer to this question?!

AddEventHandler(“playerSpawned”, function(spawn)

I know the playerSpawned event comes from spawnmanager scripts, but how could i possible know what to put in the parameters of the function?

Sometimes the function parameters are empty why and how could i know what to put in there?

Take a look at the wiki. For the playerSpawned event, the only argument is spawn. https://wiki.fivem.net/wiki/Event:PlayerSpawned

That is not the case for all of them though, check out this page for more on events:
https://wiki.fivem.net/wiki/Server_events

Thank you thank you, i understood that but for example if i made my own event
“AddEventHandler(“welcomeMessage”, function(text))” This will add my event “welcomeMessage” and i googled a bit and found that the function(text) is a text but i cant find where all of these functions are stored?
Wanna help me out?

I have read through some scripts, and when they want to get the playerped they write (GetPlayerPed(-1))

Why the “-1” i know it want the players id but why -1?

-1 is the player calling it.

Yep, tbh you dont even -1, you could just write (playerID) it still works, atleast on the script i have!

Because you have a local playerID.
local playerID = GetPlayerPed(-1)