Ped Drop on Death

How do I add a drop here? Every function I find needs a “player” and I don’t know how to call on a player in this for loop. :confused:

		for i, ped in pairs(peds) do
			if not DoesEntityExist(ped) then
				table.remove(peds, i)
			elseif IsPedDeadOrDying(ped, 1) then
                aiming, ent = GetEntityPlayerIsFreeAimingAt(PlayerId(), Citizen.ReturnResultAnyway())
                if IsEntityAPed(ent) then
                    if IsEntityDead(ent) then
                        PlaySound(-1, "LOCAL_PLYR_CASH_COUNTER_INCREASE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", 0, 0, 1)
-------------------------I want to put it here but can't find a way to
                    end
                end
				Citizen.InvokeNative(GetHashKey(choosenPed), Citizen.PointerValueIntInitialized(ped))
          
				table.remove(peds, i)
			else
			end
		end

I’m using ESX, so I could add a money drop, weapon drop, something like that right? They all use the player data type and I can’t seem to access it inside this loop.

have you tried SetPedDropsWeaponWhenDead?

I’ll try that - but what I really am aiming to accomplish here is to call something that adds money to the player’s account.

You’d most likely have to use the pickup natives