lomarrone 1 Postado Junho 14, 2010 Share Postado Junho 14, 2010 eu vi a spell buraco negro , mas n tá dando pra usar , dá esse erro : [Error - LuaScriptInterface::loadFile] data/spells/scripts/buraco negro.lua:38: '}' expected near '53' [Warning - Event::loadScript] Cannot load script (data/spells/scripts/buraco negro.lua) data/spells/buraco negro.lua:38: '}' expected near '53' o script da spell é essa : local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 3, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function abs(i) if(i>0) then return i else return (i*(-1)) end end function onCastSpell(cid, var) pos=getPlayerPosition(cid) player = getThingfromPos({x=pos.x,y=pos.y,z=pos.z,stackpos= 253}) raio=5 --alcance do buraco negro i=((pos.x)-raio) while(i<=((pos.x)+raio)) do j=((pos.y)-raio) while(j<=((pos.y)+raio)) do player=getThingfromPos({x=i,y=j,z=pos.z,stackpos=2 53}) if(((getPlayerLevel(player.uid)>0) or (isCreature(player.uid)==1))and ((abs(i-(pos.x)) > 1) or (abs(j-(pos.y)) > 1))) then -- calcula novo X if(i<pos.x) then newx=i+1 elseif(i==pos.x) then newx=i else newx=i-1 end -- calcula novo Y if(j<pos.y) then newy=j+1 elseif(j==pos.y) then newy=j else newy=j-1 end npos={x=newx,y=newy,z=pos.z} doSendMagicEffect(npos,12) doTeleportThing(player.uid,npos) end j=j+1 end i=i+1 end doCombat(cid, combat, var) end esse script é do Yazoo Link para o comentário https://xtibia.com/forum/topic/134935-spell/ Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Junho 14, 2010 Share Postado Junho 14, 2010 tenta agr local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 3, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function abs(i) if(i>0) then return i else return (i*(-1)) end end function onCastSpell(cid, var) pos=getPlayerPosition(cid) player=getThingfromPos({x=pos.x,y=pos.y,z=pos.z,stackpos=253}) raio=5 --alcance do buraco negro i=((pos.x)-raio) while(i<=((pos.x)+raio)) do j=((pos.y)-raio) while(j<=((pos.y)+raio)) do player= getThingfromPos({x=i,y=j,z=pos.z,stackpos=253}) if(((getPlayerLevel(player.uid)>0) or (isCreature(player.uid)==1))and ((abs(i-(pos.x)) > 1) or (abs(j-(pos.y)) > 1))) then -- calcula novo X if(i<pos.x) then newx=i+1 elseif(i==pos.x) then newx=i else newx=i-1 end -- calcula novo Y if(j<pos.y) then newy=j+1 elseif(j==pos.y) then newy=j else newy=j-1 end npos={x=newx,y=newy,z=pos.z} doSendMagicEffect(npos,12) doTeleportThing(player.uid,npos) end j=j+1 end i=i+1 end doCombat(cid, combat, var) end Link para o comentário https://xtibia.com/forum/topic/134935-spell/#findComment-890355 Compartilhar em outros sites More sharing options...
0 lomarrone 1 Postado Junho 14, 2010 Autor Share Postado Junho 14, 2010 deu esse erro agora : [Error - Spell Interface] data/spells/scripts/buraco negro.lua:onCastSpell Description: (internalGetPlayerInfo) Player not found when requesting player info #3 [Error - Spell Interface] data/spells/scripts/aburaco negro.lua:onCastSpell Description: data/spells/scripts/buraco negro.lua:39: attempt to compare number with boolean stack traceback: data/spells/buraco negro.lua:39: in function <data/spells/scripts/buraco negro.lua:30> já arrumei , valeu pela ajuda Link para o comentário https://xtibia.com/forum/topic/134935-spell/#findComment-890359 Compartilhar em outros sites More sharing options...
0 Henrique Moura 193 Postado Junho 14, 2010 Share Postado Junho 14, 2010 Sanado - movido Link para o comentário https://xtibia.com/forum/topic/134935-spell/#findComment-890431 Compartilhar em outros sites More sharing options...
0 mezuf 0 Postado Junho 22, 2012 Share Postado Junho 22, 2012 Marumbizinho, deu esse erro agora : [Error - Spell Interface] data/spells/scripts/buraco negro.lua:onCastSpell Description: (internalGetPlayerInfo) Player not found when requesting player info #3 [Error - Spell Interface] data/spells/scripts/aburaco negro.lua:onCastSpell Description: data/spells/scripts/buraco negro.lua:39: attempt to compare number with boolean stack traceback: data/spells/buraco negro.lua:39: in function <data/spells/scripts/buraco negro.lua:30> já arrumei , valeu pela ajuda Teria como passar o seu? Aqui deu o msmo erro, mas nao consegui arrumar ;S VALEU! Link para o comentário https://xtibia.com/forum/topic/134935-spell/#findComment-1283060 Compartilhar em outros sites More sharing options...
Pergunta
lomarrone 1
eu vi a spell buraco negro , mas n tá dando pra usar , dá esse erro :
o script da spell é essa :
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 3, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function abs(i) if(i>0) then return i else return (i*(-1)) end end function onCastSpell(cid, var) pos=getPlayerPosition(cid) player = getThingfromPos({x=pos.x,y=pos.y,z=pos.z,stackpos= 253}) raio=5 --alcance do buraco negro i=((pos.x)-raio) while(i<=((pos.x)+raio)) do j=((pos.y)-raio) while(j<=((pos.y)+raio)) do player=getThingfromPos({x=i,y=j,z=pos.z,stackpos=2 53}) if(((getPlayerLevel(player.uid)>0) or (isCreature(player.uid)==1))and ((abs(i-(pos.x)) > 1) or (abs(j-(pos.y)) > 1))) then -- calcula novo X if(i<pos.x) then newx=i+1 elseif(i==pos.x) then newx=i else newx=i-1 end -- calcula novo Y if(j<pos.y) then newy=j+1 elseif(j==pos.y) then newy=j else newy=j-1 end npos={x=newx,y=newy,z=pos.z} doSendMagicEffect(npos,12) doTeleportThing(player.uid,npos) end j=j+1 end i=i+1 end doCombat(cid, combat, var) endesse script é do Yazoo
Link para o comentário
https://xtibia.com/forum/topic/134935-spell/Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados