• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Inq 1.0 error when killing twinboss

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Hello..
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
 
Is this the script that came with your pack?
Code:
local bosses = {
   ["ushuriel"] = 200,
   ["zugurosh"] = 201,
   ["madareth"] = 202,
   ["latrivan"] = 203,
   ["golgordan"] = 203,
   ["annihilon"] = 204,
   ["hellgorak"] = 205
}

function onKill(cid, target)
   if(bosses[string.lower(getCreatureName(target))]) then
     if(string.lower(getCreatureName(target)) == "latrivan" or string.lower(getCreatureName(target)) == "golgordan") then   
       setGlobalStorageValue(bosses[string.lower(getCreatureName(target))], getGlobalStorageValue(bosses[string.lower(getCreatureName(target))]) < 1 and 1 or 2)
       if(getGlobalStorageValue(bosses[string.lower(getCreatureName(target))]) == 2) then
         doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room.", TALKTYPE_ORANGE_1)
         addEvent(setGlobalStorageValue, 3 * 60 * 1000, bosses[string.lower(getCreatureName(target))], 0)
       end
       return true
     end
     doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room.", TALKTYPE_ORANGE_1)
     setGlobalStorageValue(bosses[string.lower(getCreatureName(target))], 2)
     addEvent(setGlobalStorageValue, 3 * 60 * 1000, bosses[string.lower(getCreatureName(target))], 0)
   end
   return true
end
 
Nvm @Ninja helped me, if you got TFS 1.0 change
Code:
local brother = getCreatureByName(t.brother)
to
Code:
local brother = Creature(t.brother)
 
Back
Top