So I’m trying to give a weapon to a player who kills another player using onPlayerKilled. The problem is that the killerID is always -1
This is the server script:
RegisterNetEvent("baseevents:onPlayerKilled")
AddEventHandler("baseevents:onPlayerKilled", function(killerID, deathData)
local victim = source
print("victim: "..tostring(victim).." | killer: "..tostring(killerID))
TriggerClientEvent("test", killerID, victim)
end)
The message in the console:
victim: 8 | killer: -1
No matter how the killer kills and who kills.
If someone knows how to help me please reply, thanks!