Hello! I rly need u guys skills to solve my problem.
I'm using 2 scripts made by Zakius. When i use tps in the quest im getting these error messages in console::blink:
movements.lua
creaturescripts.lua
Whats wrong :O?
Thanks in advance!
I'm using 2 scripts made by Zakius. When i use tps in the quest im getting these error messages in console::blink:
Code:
[Error - MoveEvents Interface]
data/movements/scripts/inqteleports.lua:onStepIn
Description:
data/movements/scripts/inqteleports.lua:52: attempt to call global 'doCreatureSa
yWithDelay' (a nil value)
stack traceback:
data/movements/scripts/inqteleports.lua:52: in function <data/movements/
scripts/inqteleports.lua:31>
movements.lua
Lua:
local config = {
bosses={---aid of portal, position where it sends, value it sets, text it shows
[10001] = {pos={x=361, y=636, z=4, stackpos=1}, value=1, text="Entering The Crystal Caves"},
[10002] = {pos={x=311, y=703, z=4, stackpos=1}, value=2, text="Entering The Blood Halls"},
[10003] = {pos={x=421, y=752, z=4, stackpos=1}, value=3, text="Entering The Vats"},
[10004] = {pos={x=319, y=730, z=4, stackpos=1}, value=4, text="Entering The Arcanum"},
[10005] = {pos={x=259, y=785, z=4, stackpos=1}, value=5, text="Entering The Hive"},
[10006] = {pos={x=301, y=786, z=4, stackpos=1}, value=6, text="Entering The Shadow Nexus"}
},
mainroom={---aid, position, lowest value that can use this portal, text
[20001] = {pos={x=361, y=636, z=4, stackpos=1}, value=1, text="Entering The Crystal Caves"},
[20002] = {pos={x=311, y=703, z=4, stackpos=1}, value=2, text="Entering The Blood Halls"},
[20003] = {pos={x=421, y=752, z=4, stackpos=1}, value=3, text="Entering The Vats"},
[20004] = {pos={x=317, y=730, z=4, stackpos=1}, value=4, text="Entering The Arcanum"},
[20005] = {pos={x=259, y=785, z=4, stackpos=1}, value=5, text="Entering The Hive"} },
portals={---aid, position, text
[30000] = {pos={x=427, y=891, z=6}, text="Escaping back to the Retreat"},
[30001] = {pos={x=418, y=878, z=4}, text="Entering The Ward of Ushuriel"},
[30002] = {pos={x=1472, y=469, z=11}, text="Entering The Sunken Cave"},
[30003] = {pos={x=418, y=827, z=4}, text="Entering The Ward of Zugurosh"},
[30004] = {pos={x=331, y=681, z=4}, text="Entering The Foundry"},
[30005] = {pos={x=460, y=884, z=4}, text="Entering The Ward of Madareth"},
[30006] = {pos={x=413, y=788, z=4}, text="Entering The Battlefield"},
[30007] = {pos={x=426, y=859, z=4}, text="Entering The Demon Brothers'Ward"},
[30008] = {pos={x=1526, y=539, z=11}, text="Entering The Soul Wells"},
[30009] = {pos={x=1473, y=614, z=13}, text="Entering The Ward of Annihilon"},
[30010] = {pos={x=1478, y=656, z=11}, text="Entering The Ward of Hellgorak"} },
storage=56123,---storage used in boss and mainroom portals
walkback="You don't have enough energy to enter this portal",---message if you cannot use mainroom portal
e={} }----dunno whats this but have to be like this to make doCreatureSayWithDelay working, DON'T TOUCH}
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
if(config.bosses[item.actionid]) then
local t= config.bosses[item.actionid]
if getPlayerStorageValue(cid, config.storage)< t.value then
setPlayerStorageValue(cid, config.storage, t.value)
end
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1, config.e)
elseif(config.mainroom[item.actionid]) then
local t= config.mainroom[item.actionid]
if getPlayerStorageValue(cid, config.storage)>=t.value then
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1,config.e)
else
doTeleportThing(cid, fromPosition)
doCreatureSay(cid, config.walkback, 19)
end
elseif(config.portals[item.actionid]) then
local t= config.portals[item.actionid]
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1,config.e)
end
end
end
creaturescripts.lua
Lua:
local config = {
timeToRemove = 180, -- seconds
message = "Go into the teleport in 3 minutes, else it will disappear.",
teleportId = 1387,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x=417, y=879, z=4, stackpos=2 }, aid=10001 },
["Zugurosh"] = { pos={ x=414, y=828, z=4, stackpos=2 }, aid=10002},
["Madareth"] = { pos={ x=459, y=885, z=4, stackpos=2 }, aid=10003},
["Annihilon"] = { pos={ x=459, y=835, z=4, stackpos=2 }, aid=10005},
["Hellgorak"] = { pos={ x=459, y=863, z=4, stackpos=2 }, aid=10006}
},
brothers ={
["Golgordan"] = {pos={ x=427, y=860, z=4, stackpos=1 },aid=10004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=427, y=860, z=4, stackpos=1 },aid=10004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 419, y = 850, z = 4},
toPos = {x = 435, y = 860, z = 4} } }
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
elseif(config.brothers[getCreatureName(target)]) then
local t = config.brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
return TRUE
end
else
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end
Whats wrong :O?
Thanks in advance!