I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).
I'm making this quest where sometimes a broadcast msg will happen when you use the chest. But i ran into the following error after using my chest.
[09/08/2014 17:17:28] Lua Script Error: [Action Interface]
[09/08/2014 17:17:28] data/actions/scripts/quests/explosive treasure chest.luanUse
[09/08/2014 17:17:28] .../actions/scripts/quests/explosive treasure chest.lua:15: attempt to call global 'doBroadcastMessage' (a nil value)
[09/08/2014 17:17:28] stack traceback:
[09/08/2014 17:17:28] .../actions/scripts/quests/explosive treasure chest.lua:15: in function <.../actions/scripts/quests/explosive treasure chest.lua:1>
Server\data\actions\scripts\quests\explosive treasure chest.lua
If anyone could help me out, that would be great!
Thanks in advance.
I'm making this quest where sometimes a broadcast msg will happen when you use the chest. But i ran into the following error after using my chest.
[09/08/2014 17:17:28] Lua Script Error: [Action Interface]
[09/08/2014 17:17:28] data/actions/scripts/quests/explosive treasure chest.luanUse
[09/08/2014 17:17:28] .../actions/scripts/quests/explosive treasure chest.lua:15: attempt to call global 'doBroadcastMessage' (a nil value)
[09/08/2014 17:17:28] stack traceback:
[09/08/2014 17:17:28] .../actions/scripts/quests/explosive treasure chest.lua:15: in function <.../actions/scripts/quests/explosive treasure chest.lua:1>
Server\data\actions\scripts\quests\explosive treasure chest.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local function doTransformBack(pos, itemid, transformid)
return doTransformItem(getTileItemById(pos, transformid).uid, itemid)
end
if itemEx.itemid == 5675 and item.uid == 5569 then
local rand = math.random(1, 2)
if rand == 1 then
doSendMagicEffect(toPosition,CONST_ME_FIREAREA)
doTargetCombatHealth(0, cid, COMBAT_FIREDAMAGE, -100, -100, CONST_ME_NONE)
doCreatureSay(cid, "KABOOM!", TALKTYPE_ORANGE_1)
doTransformItem(itemEx.uid, 2255)
addEvent(doTransformBack, 42*60*1, toPosition, itemEx.itemid, 2255)
doBroadcastMessage("Boys! To arms!!!")
else
doSendMagicEffect(toPosition,CONST_ME_FIREAREA)
doTargetCombatHealth(0, cid, COMBAT_FIREDAMAGE, -100, -100, CONST_ME_NONE)
doCreatureSay(cid, "KABOOM!", TALKTYPE_ORANGE_1)
doTransformItem(itemEx.uid, 2255)
addEvent(doTransformBack, 28*60*1, toPosition, itemEx.itemid, 2255)
end
end
end
If anyone could help me out, that would be great!
Thanks in advance.