Ir para conteúdo
  • 0

me ajuda a tirar esse error aqui


tonynamoral

Pergunta

fala ai galera , eu criei um script , ai eu fui tentar adicionar uma funçao que se tipo

 

voce escreve o nome da magia , ai aparece numeradamente as magias

 

script :

 

 

 

local spells = {

["gale"] = {id = 2385, name = "Gale", level = "30", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},

["energy explosion"] = {id = 2378, name = "Energy Explosion", level = "50", type = "Attack", effect = "none", vocation = "Mage", cooldown = "6 Seconds"},

["twisting slash"] = {id = 2376, name = "Twisting Slash", level = "40", type = "Attack", effect = "none", vocation = "warrior", cooldown = "4 Seconds"},

["elemental hits"] = {id = 2377, name = "Elemental Hits", level = "15", type = "Attack", effect = "none", vocation = "Elf", cooldown = "4 Seconds"},

["meteor"] = {id = 2382, name = "Meteor", level = "45", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},

["invisibility"] = {id = 2382, name = "Invisibility", level = "25", type = "Support", effect = "40secs of invisibility", vocation = "Mage", cooldown = "3 Minutes"},

}

local spellsa = {"gale", "energy explosion", "twisting slash", "elemental hits", "meteor", "invisibility"}

 

function onTextEdit(cid,item,newText)

if item.itemid == 1949 then

local t = spells[newText]

if not t then

return true

end

for s = 1, #spellsa do

local spellsall = spellsa

if newText == "spells" then

doShowTextDialog(cid,1949,"--> All Spells <--\n\n"..s..". "..spellsall.."")

else

doShowTextDialog(cid,t.id,"--> Spells Information <--\n\nName: "..t.name.."\nLevel: "..t.level.."\nType: "..t.type.."\nEffect: "..t.effect.."\nVocation: "..t.vocation.."\nCooldown: "..t.cooldown.."")

return true

end

end

end

end

 

 

 

porém , dps que eu adicionei isso , naum funfo mais o script e tbm nao deu bug no console , help please

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

tenta assim..

 

local spells = {
["gale"] = {id = 2385, name = "Gale", level = "30", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},
["energy explosion"] = {id = 2378, name = "Energy Explosion", level = "50", type = "Attack", effect = "none", vocation = "Mage", cooldown = "6 Seconds"},
["twisting slash"] = {id = 2376, name = "Twisting Slash", level = "40", type = "Attack", effect = "none", vocation = "warrior", cooldown = "4 Seconds"},
["elemental hits"] = {id = 2377, name = "Elemental Hits", level = "15", type = "Attack", effect = "none", vocation = "Elf", cooldown = "4 Seconds"},
["meteor"] = {id = 2382, name = "Meteor", level = "45", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},
["invisibility"] = {id = 2382, name = "Invisibility", level = "25", type = "Support", effect = "40secs of invisibility", vocation = "Mage", cooldown = "3 Minutes"},
}
local spellsa = {"gale", "energy explosion", "twisting slash", "elemental hits", "meteor", "invisibility"}

function onTextEdit(cid,item,newText)
local table = {}   

if item.itemid == 1949 then
  local t = spells[newText]
  if t then   
  doShowTextDialog(cid, t.id, "--> Spells Information <--\n\nName: "..t.name.."\nLevel: "..t.level.."\nType: "..t.type.."\nEffect: "..t.effect.."\nVocation: "..t.vocation.."\nCooldown: "..t.cooldown.."")
  return true
  elseif newText == "spells" then
  table.insert(table, "--> All Spells <--\n\n")
  for s = 1, #spellsa do
	  table.insert(table, s.."° "..spellsa[s])
  end
  doShowTextDialog(cid, 1949, table.concat(table, "\n"))
  return true
  end
end
return true
end

 

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

  • 0

Error :

 

 

[14/01/2013 20:23:39] [Error - CreatureScript Interface]

[14/01/2013 20:23:39] data/creaturescripts/scripts/skillsinfo.lua:onTextEdit

[14/01/2013 20:23:39] Description:

[14/01/2013 20:23:39] data/creaturescripts/scripts/skillsinfo.lua:20: attempt to call field 'insert' (a nil value)

[14/01/2013 20:23:39] stack traceback:

[14/01/2013 20:23:39] data/creaturescripts/scripts/skillsinfo.lua:20: in function <data/creaturescripts/scripts/skillsinfo.lua:11>

Link para o comentário
Compartilhar em outros sites

  • 0

achu q deu comflito kk tenta assim..

 

[/code]local spells = {

["gale"] = {id = 2385, name = "Gale", level = "30", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},

["energy explosion"] = {id = 2378, name = "Energy Explosion", level = "50", type = "Attack", effect = "none", vocation = "Mage", cooldown = "6 Seconds"},

["twisting slash"] = {id = 2376, name = "Twisting Slash", level = "40", type = "Attack", effect = "none", vocation = "warrior", cooldown = "4 Seconds"},

["elemental hits"] = {id = 2377, name = "Elemental Hits", level = "15", type = "Attack", effect = "none", vocation = "Elf", cooldown = "4 Seconds"},

["meteor"] = {id = 2382, name = "Meteor", level = "45", type = "Attack", effect = "none", vocation = "Mage", cooldown = "10 Seconds"},

["invisibility"] = {id = 2382, name = "Invisibility", level = "25", type = "Support", effect = "40secs of invisibility", vocation = "Mage", cooldown = "3 Minutes"},

}

local spellsa = {"gale", "energy explosion", "twisting slash", "elemental hits", "meteor", "invisibility"}

 

function onTextEdit(cid,item,newText)

local tb = {}

 

if item.itemid == 1949 then

local t = spells[newText]

if t then

doShowTextDialog(cid, t.id, "--> Spells Information <--\n\nName: "..t.name.."\nLevel: "..t.level.."\nType: "..t.type.."\nEffect: "..t.effect.."\nVocation: "..t.vocation.."\nCooldown: "..t.cooldown.."")

return true

elseif newText == "spells" then

table.insert(tb, "--> All Spells <--\n\n")

for s = 1, #spellsa do

table.insert(tb, s.."° "..spellsa)

end

doShowTextDialog(cid, 1949, table.concat(tb, "\n"))

return true

end

end

return true

end[/code]

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...