Postado Janeiro 16, 2013 12 anos Olá, venho aqui pedir à alguem que possa me ajudar. É o seguinte tenho um script que está "sem erros" porém do "nada" ele buga a storage que está sendo executada( ficando com alguns simbolos no lugar do numero. Olhe a imagem para verem como está ficando.) O que o script faz, é quase o mesmo sistema que já vi aqui do Level Points, ao upar ganha 2 pontos para comprar em um npc, porém meu otserv é de HIGH-EXP com Reset System, então no começo funciona normalmente mais depois começa a dar esses bugs e impossibita os players de logarem(o que bugou) e fica dando esse erro no console toda hora. Imagem como está ficando a database. [Error - CreatureScript Interface] data / creaturescripts / scripts / attribute_points.lua: onAdvance Description: data / creaturescripts / scripts / attribute_points.lua: 6: attempt to perform arithmetic on a string value stack traceback: data / creaturescripts / scripts / attribute_points.lua: 6: in function <data/creaturescripts/scripts/attribute_points.lua:1> E aqui se encontra o script function onAdvance(cid, skill, oldlevel, newlevel) if skill == 8 then if oldlevel < newlevel then local addmana = getPlayerMaxMana(cid) local addhp = getCreatureMaxHealth(cid) local addattribute = (getPlayerStorageValue(cid, 47061)+(newlevel-oldlevel)*2) -- this is the line that corrupts the database and displays this error "attempt to perform arithmetic on a string value" doSendAnimatedText(getPlayerPosition(cid), "Level UP", 129) doSendMagicEffect(getPlayerPosition(cid),math.random(28, 30)) doCreatureAddHealth(cid, addhp) doPlayerAddMana(cid, addmana) setPlayerStorageValue(cid, 47061, addattribute) end end return true end OBS: O script funciona perfeitamente em TFS 0.3.4, mas no TFS 0.3.6 funciona por um periodo curto de tempo. Não se se tem que editar na sourcer ou no script, mas já não sei o que fazer. OBS2: Mesmo com esse sistema http://tibiaking.com...e-level-points/ dá o mesmo erro, não sei se é por causa da high-exp ou do reset system, mas é um sistema essencial para meu otserv. Agradeço à todos que lerem e tentarem ajudar
Postado Janeiro 18, 2013 12 anos function onAdvance(cid, skill, oldlevel, newlevel) local attribute = getPlayerStorageValue(cid, 47061) + (oldLevel - newLevel) * 2 if skill == 8 then doSendMagicEffect(getThingPos(cid), math.random(28, 30)) doSendAnimatedText(getThingPos(cid), "LEVEL UP!", math.random(1, 255)) doCreatureAddHealth(cid, getCreatureHealth(cid) - getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMane(cid) - getCreatureMaxMana(cid)) setPlayerStorageValue(cid, 47061, attribute) end return true end #ESSAPORRADEIDENTAÇÃOSEMPREBUGASIFUDE. Editado Janeiro 18, 2013 12 anos por Skyforever (veja o histórico de edições)
Postado Janeiro 18, 2013 12 anos Autor deu esse erro aqui [18/01/2013 10:42:30] [Error - CreatureScript Interface] [18/01/2013 10:42:30] data/creaturescripts/scripts/attribute_points.lua:onAdvance [18/01/2013 10:42:30] Description: [18/01/2013 10:42:30] data/creaturescripts/scripts/attribute_points.lua:3: attempt to perform arithmetic on global 'oldLevel' (a nil value) [18/01/2013 10:42:30] stack traceback: [18/01/2013 10:42:30] data/creaturescripts/scripts/attribute_points.lua:3: in function <data/creaturescripts/scripts/attribute_points.lua:1>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.