Hi Otlanders!
I am having a problem with my current script: Pillar quest
Some short info what this script SHOULD do,
1. You use a hammer at the pillar
2. When the hammer is used at the pillar, the pillar shall turn into a broken pillar
3. If, all 4 pillars are broken pillars a monster shall spawn.
Here is the script:
I am getting this error when using this script:
The Transform part doesn't work, because the value is an index, not a value.
I now ask you, how I should solve this problem.
Thanks in advance!
I am having a problem with my current script: Pillar quest
Some short info what this script SHOULD do,
1. You use a hammer at the pillar
2. When the hammer is used at the pillar, the pillar shall turn into a broken pillar
3. If, all 4 pillars are broken pillars a monster shall spawn.
Here is the script:
Lua:
local config = {
mpos = {x=10001, y=10644,z=7},
monster = "Dwarf",
hammer = 2557, -- Hammmer/item id.
pillar = 3766, -- Pillar Id
broken_pillar = 3767,
cancel = "This pillar is already broken.",
pillars_uid = {
[3002] = { text="BROOOOM!!"},
[3003] = { text="BRAAAM!!"},
[3004] = { text="Kaboom!!"},
[3005] = { text="Badam!!"}
},
}
function reset()
doTransformItem(configt.pillars_aid[item.uid], pillar)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid == config.pillar and item.itemid == config.hammer then
local x = config.pillars_uid[item.uid]
doTransformItem(x, config.broken_pillar)
doPlayerSendTextMessage(cid, 19, x.text)
addEven(reset, 90000)
if config.pillars_uid[1] == config.broken_pillar and config.pillars_uid[2] == config.broken_pillar and config.pillars_uid[3] == config.broken_pillar and config.pillars_ud[4] == config.broken_pillar then
doSummonCreature(config.monster, config.mpos)
end
else
doPlayerSendTextMessage(cid, 19, config.cancel)
end
return TRUE
end
I am getting this error when using this script:
Code:
[Error - Action Interface]
data/actions/scripts/pillar_quest.lua:onUse
Description:
data/actions/scripts/pillar_quest.lua:26: attempt to index local 'x' (a nil valu
e)
stack traceback:
data/actions/scripts/pillar_quest.lua:26: in function <data/actions/scri
pts/pillar_quest.lua:22>
The Transform part doesn't work, because the value is an index, not a value.
I now ask you, how I should solve this problem.
Thanks in advance!