Plate Posted February 11, 2013 Share Posted February 11, 2013 Hola tengo un problema con esto lo que pasa es que yo mato a un bot y la columna "EXP" queda en 0 y la otra cosa es que tampoco sube el level function LVL(ammo, killer, weapon, bodypart) local exp = getElementData(killer, "EXP") local lvl = getElementData(killer, "Level") setElementData(killer, "EXP", tonumber(exp)+10) triggerClientEvent ( killer, "playSound" , killer ) if levels[tonumber(exp)] then setElementData(killer, "Level", "Level ".. levels[tonumber(exp)] .." !") triggerClientEvent ( killer, "LevelUP" , killer ) end end end addEventHandler( "onBotWasted", getRootElement(), LvL) function respawn ( ) setElementData ( source, "Level", 0 ) setElementData ( source, "EXP", 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), respawn ) Link to comment
Castillo Posted February 11, 2013 Share Posted February 11, 2013 Pone: addEvent ( "onBotWasted", true ) ademas del addEventHandler. Link to comment
Plate Posted February 11, 2013 Author Share Posted February 11, 2013 Me sigue diciendo 0 Link to comment
Castillo Posted February 11, 2013 Share Posted February 11, 2013 El primer argumento de "onBotWasted" es el que lo mato, no la municion. Link to comment
Plate Posted February 11, 2013 Author Share Posted February 11, 2013 Lo puse asi function LVL(killer, ammo, weapon, bodypart) y sigue sin andar Link to comment
Plate Posted February 12, 2013 Author Share Posted February 12, 2013 Alguien va a contestar esto? Link to comment
Alexs Posted February 12, 2013 Share Posted February 12, 2013 Solo de curiosidad, postea la tabla 'levels'. Link to comment
Plate Posted February 12, 2013 Author Share Posted February 12, 2013 local levels = {[250] = 1, [400] = 2, [1000] = 3, [1250] = 4, [1750] = 5, [2518] = 6, [3000] = 7, [3740] = 8, [4000] = 9, [4315] = 10, [4980] = 11, [5318] = 12} me faltan muchos mas Link to comment
Recommended Posts