Need help getting the player of currently executing a client script in Lua

I am creating a client script in Lua and I need to run a function that requires a player as a parameter, and I want to use the player currently running the script. I have looked online but I have not found any method of doing so.

P.S. Sorry if this post is in thee wrong category. I tried to put it in Resource Development & Modding but I was unable to, and I found this topic where a staff member said to post somewhere else and it will be moved: Problem with creating topics on fivem forum

local ped = PlayerPedId() -- clients player ped
local pid = PlayerId() -- clients server id.

You mean this?

1 Like

Yes! This is what I was looking for, thank you.