• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Error - Spell Interface] - attempt to index global 'compConfig' (a nil value)

oskar1415

New Member
Joined
Apr 14, 2010
Messages
21
Reaction score
0
Witam. Zacząłem bawić się ots'mi. Sciągnęłem pierwszy lepszy silnik i go odpaliłem. Gdy chciałem użyć czaru (exevo gran mas frigo/vis/tera/flam) po tym yskoczył błąd w konsoli.


[21:50:39.423] [Error - Spell Interface]
[21:50:39.423] data/spells/scripts/attack/eternal winter.lua:eek:nCastSpell
[21:50:39.424] Description:
[21:50:39.425] data/spells/scripts/attack/eternal winter.lua:38: attempt to inde
x global 'compConfig' (a nil value)
[21:50:39.425] stack traceback:
[21:50:39.425] data/spells/scripts/attack/eternal winter.lua:38: in function <d
ata/spells/scripts/attack/eternal winter.lua:19>



data/spells/scripts/attack/eternal winter.lua
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)

function onGetFormulaValues(cid, level, maglevel)
local min = level * 2 + maglevel * 5
local max = level * 3 + maglevel * 6
return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)


local castleStorage, ctfStorage, dtbStorage, rushStorage = '11101', '11201', '11301', '11401'


function onCastSpell(cid, var)
domodlib('castle_config')
domodlib('DTB_config')
domodlib('CTF_config')
domodlib('config_rush_event')
domodlib('competition_config')

if getCreatureStorage(cid, castleCfg.storage.playersEvent) == 1 then
if exhaustion.check(cid, castleStorage) ~= false then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
elseif (getCreatureStorage(cid, dtbConfig.blue.storage) == 1) or (getCreatureStorage(cid, dtbConfig.red.storage) == 1) then
if exhaustion.check(cid, ctfStorage) ~= false then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
elseif (getCreatureStorage(cid, ctfConfig.blue.storage) == 1) or (getCreatureStorage(cid, ctfConfig.red.storage) == 1) then
if exhaustion.check(cid, dtbStorage) ~= false then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
elseif tostring(getCreatureStorage(cid, compConfig.fighter)) == 'true' then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You can\'t use this spell on Guild Competition War.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
elseif tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
if exhaustion.check(cid, rushStorage) ~= false then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
end

return doCombat(cid, combat, var), exhaustion.set(cid, castleStorage, 300), exhaustion.set(cid, ctfStorage, 20), exhaustion.set(cid, dtbStorage, 20), exhaustion.set(cid, rushStorage, 20)
end

Nie mam pojęcia jak to naprawić. Może brakuje jakieś funkcji w lib/source?
 
Czary tyczą się eventów, spells pobiera config np z modsa, gdy nie masz danego eventu nie możesz użyć czaru, bo jest error :) polecam usunąć linijki ze nazwaczaru.lua lub dodać eventy.. :p
 
hmm... pomyślmy... nie? To tak jak byś zmienił z getTwojaStaraLata() na getTwojaCiotkaLata(), bo silnik nie obsluguje twojej starej i zastanawial sie czy bedzie bralo lata tej samej osoby...
 

Similar threads

Back
Top