Search the Community
Showing results for tags 'exp_kill'.
-
Have an error in server.lua Goes out me this in the console : ERROR: SistemaDeLevels/server.lua:10: attempt to perform arithmetic on global 'exp_kill' (a boolean value) Some help please ? code .. nivel_maximo = get("nivel.NivelMaximo") nivel_minimo = get("nivel.NivelInicial") exp_kill = get("nivel.ExpPorKill") exp_nivel = get("nivel.ExpParaNivel") perder_exp = get("nivel.PerderExpAlMorir") -- Valores true o false function morir ( ammo, killer, weapon, bodypart ) if ( killer ) and ( killer ~= source ) then exp_reciente = getElementData(killer, "exp") + exp_kill if exports.zombies:isPedZombie(source) then if exp_reciente >= exp_nivel then if getElementData(killer, "nivel") < nivel_maximo then setElementData(killer, "nivel", getElementData(killer, "nivel")+1) setElementData(killer, "exp", exp_reciente-exp_nivel) outputChatBox("[Sistema de Niveles]: ¡Has subido de nivel! Ahora tu nivel es:#FF0000 "..getElementData(killer, "nivel")..".", killer, 0, 255, 0, true) if getElementData(killer, "nivel") >= 50 then outputChatBox("Excelente Pasaste al Siguiente Nivel.", killer, 0, 255, 0, true) end end else setElementData(killer, "exp", exp_reciente) end end end end addEventHandler ( "onPedWasted", getRootElement(), morir )