Ir para conteúdo
  • 0

Spell


lomarrone

Pergunta

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
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

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
Compartilhar em outros sites

  • 0

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
Compartilhar em outros sites

  • 0

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
Compartilhar em outros sites

×
×
  • Criar Novo...