Hello..
Error:
creaturescript.lua
Error:
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/inquisition/Inquisition.lua:onKill
data/creaturescripts/scripts/inquisition/Inquisition.lua:34: attempt to call glo
bal 'getCreatureByName' (a nil value)
stack traceback:
[C]: in function 'getCreatureByName'
data/creaturescripts/scripts/inquisition/Inquisition.lua:34: in function
<data/creaturescripts/scripts/inquisition/Inquisition.lua:24>
creaturescript.lua
Code:
local config = {
timeToRemove = 120, -- seconds
message = "You now have 2 minutes to exit this room through the teleporter. It will bring you to the next room only during this time or the teleporter will disappear",
teleportId = 9773,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x=552, y=922, z=12, stackpos=1 }, aid=1001 },
["Zugurosh"] = { pos={ x=551, y=864, z=12, stackpos=1 }, aid=1002},
["Madareth"] = { pos={ x=594, y=933, z=12, stackpos=1 }, aid=1003},
["Annihilon"] = { pos={ x=590, y=877, z=12, stackpos=1 }, aid=1005},
["Hellgorak"] = { pos={ x=557, y=905, z=12, stackpos=1 }, aid=1006}
},
brothers ={
["Golgordan"] = {pos={ x=593, y=903, z=12, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=593, y=903, z=12, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 589, y = 891, z = 12},
toPos = {x = 605, y = 903, z = 12} } }
}
local function removal(position)
doRemoveItem(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
doSetItemActionId(teleport, 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
doSetItemActionId(teleport, t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end