Hello everyone,
sorry if my English is bad.
I have a zombie script like this:
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
for i, entity in pairs(entitys) do
playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
pedX, pedY, pedZ = table.unpack(GetEntityCoords(entity, true))
if DoesEntityExist(entity) == false then
table.remove(entitys, i)
end
if IsPedDeadOrDying(entity, 1) == 1 then
if GetPedSourceOfDeath(entity) == PlayerPedId() then
dead = dead + 1
Citizen.Wait(1000)
RandomLoot()
ClearPedSecondaryTask(GetPlayerPed(-1))
local model = GetEntityModel(entity)
SetEntityAsNoLongerNeeded(entity)
SetModelAsNoLongerNeeded(model)
table.remove(entitys, i)
exports.esx_xp:ESXP_Add(10)
end
Citizen.Wait(1000)
DeleteEntity(entity)
end
end
end
end)
I want to add when zombie dead add count zombie dead to the database.
how do I make it on the client and server side?
I really appreciate your help