waqmaz
Member
- Joined
- Jun 17, 2015
- Messages
- 203
- Reaction score
- 11
File1.lua:
File2.lua:
I do it like this:
An error in console:
Code:
sorcerer_spells = {
[1] = {spell = 'Death Strike'},
[2] = {spell = 'Flame Strike'},
[3] = {spell = 'Energy Strike'},
[4] = {spell = 'Fire Wave'},
[5] = {spell = 'Energy Beam'},
[6] = {spell = 'Great Energy Beam'},
[7] = {spell = 'Energy Wave'},
[8] = {spell = 'Rage of the Skies'},
[9] = {spell = 'Hells Core'}
}
Code:
require "data.config.player_spells_config.playerSpellsConfig"
local function unlearnSpells(vocation_unlearn, cid)
for i=1, #vocation_unlearn do
doPlayerUnlearnInstantSpell(cid, vocation_unlearn[i].spell)
end
return true
end
I do it like this:
Code:
unlearnSpells(sorcerer_spells, cid)
data/npc/scripts/file2.lua:85: attempt to get length of local 'vocation_unlearn' (a nil value)
stack traceback:
data/npc/scripts/file2.lua:85: in function 'unlearnSpells'