• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help battle field event player doesnt die

dervin13

Active Member
Joined
Apr 26, 2008
Messages
458
Solutions
1
Reaction score
28
Hello, if somebody could help me i'd be very greatfull

I'm trying to use this battle field event but I think there's some error in the function onDeath/prepare death, because when player is almost to Die the weapon dont give any hit anymore.

lib functino ondeath
Code:
    function Battlefield:onDeath(player, killer)
        local info = self:findPlayer(player)
        if not info then return false end
        if killer and killer.getName then
            local killerInfo = self:findPlayer(killer)
            if killerInfo and killerInfo.team ~= info.team then
                local killerTeam = self.teams[killerInfo.team]
                killerTeam.kills = killerTeam.kills + 1
            end
        end

        self:onLeave(player)
        return true
    end

creatuescripts code onpreparedeath
Code:
function onPrepareDeath(player, killer)
    local info = Battlefield:findPlayer(player)
    if info then
        Battlefield:onDeath(player, killer)
    end
    return false
end

thanks
 
Last edited:
Solved, it was a problem in Zombie Event that I changed to preparedeath and was bugging all the server, sorry for this and thanks for all
 
Back
Top