• 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!

Lua Door Storage

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Hello help me with this script, I want you to ask for several storages to be able to pass

these would be the other storages
  • Storage.GraveDanger.CobraBastion.DukeKill
  • Storage.GraveDanger.CobraBastion.LordKill
  • Storage.GraveDanger.CobraBastion.TwinsKill
  • Storage.GraveDanger.CobraBastion.VlarkKill
  • Storage.GraveDanger.CobraBastion.EarlKill


Lua:
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.GraveDanger.CobraBastion.DukeKill) == 1 then
        if item.actionid == 23151 then
            if item.itemid == 6261 then
                player:teleportTo(toPosition, true)
                item:transform(item.itemid + 1)
            elseif item.itemid == 6262 then
                if Creature.checkCreatureInsideDoor(player, toPosition) then
                    return true
                end
                if item.itemid == 6262 then
                    item:transform(item.itemid - 1)
                    return true
                end
            end
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
    end
    return true
end

hauntedhoused:aid(23151)
hauntedhoused:register()
 
Solution
It does not give an error in the console, but the door does not even say the event message, if not this 23:29 The door seems to be sealed against unwanted intruders.
Lua:
local function hasAllStorages(player)
    local storageKeys = {
        Storage.GraveDanger.CobraBastion.DukeKill,
        Storage.GraveDanger.CobraBastion.LordKill,
        Storage.GraveDanger.CobraBastion.TwinsKill,
        Storage.GraveDanger.CobraBastion.VlarkKill,
        Storage.GraveDanger.CobraBastion.EarlKill
    }
    for _, storageKey in pairs(storageKeys) do
        if player:getStorageValue(storageKey) <= 0 then
            return false
        end
    end
    return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item...
Hello help me with this script, I want you to ask for several storages to be able to pass

these would be the other storages
  • Storage.GraveDanger.CobraBastion.DukeKill
  • Storage.GraveDanger.CobraBastion.LordKill
  • Storage.GraveDanger.CobraBastion.TwinsKill
  • Storage.GraveDanger.CobraBastion.VlarkKill
  • Storage.GraveDanger.CobraBastion.EarlKill


Lua:
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.GraveDanger.CobraBastion.DukeKill) == 1 then
        if item.actionid == 23151 then
            if item.itemid == 6261 then
                player:teleportTo(toPosition, true)
                item:transform(item.itemid + 1)
            elseif item.itemid == 6262 then
                if Creature.checkCreatureInsideDoor(player, toPosition) then
                    return true
                end
                if item.itemid == 6262 then
                    item:transform(item.itemid - 1)
                    return true
                end
            end
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
    end
    return true
end

hauntedhoused:aid(23151)
hauntedhoused:register()

Try
Lua:
local function hasAllStorages(player)
    local storageKeys = {
        Storage.GraveDanger.CobraBastion.DukeKill
        Storage.GraveDanger.CobraBastion.LordKill
        Storage.GraveDanger.CobraBastion.TwinsKill
        Storage.GraveDanger.CobraBastion.VlarkKill
        Storage.GraveDanger.CobraBastion.EarlKill   
    }
    for _, storageKey in pairs(storageKeys) do
        if player:getStorageValue(storageKey) <= 0 then
            return false
        end
    end
    return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if hasAllStorages(player) then
        if item.actionid == 23151 then
            if item.itemid == 6261 then
                player:teleportTo(toPosition, true)
                item:transform(item.itemid + 1)
            elseif item.itemid == 6262 then
                if Creature.checkCreatureInsideDoor(player, toPosition) then
                    return true
                end
                if item.itemid == 6262 then
                    item:transform(item.itemid - 1)
                    return true
                end
            end
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
    end
    return true
end
hauntedhoused:aid(23151)
hauntedhoused:register()
 
Try
Lua:
local function hasAllStorages(player)
    local storageKeys = {
        Storage.GraveDanger.CobraBastion.DukeKill
        Storage.GraveDanger.CobraBastion.LordKill
        Storage.GraveDanger.CobraBastion.TwinsKill
        Storage.GraveDanger.CobraBastion.VlarkKill
        Storage.GraveDanger.CobraBastion.EarlKill  
    }
    for _, storageKey in pairs(storageKeys) do
        if player:getStorageValue(storageKey) <= 0 then
            return false
        end
    end
    return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if hasAllStorages(player) then
        if item.actionid == 23151 then
            if item.itemid == 6261 then
                player:teleportTo(toPosition, true)
                item:transform(item.itemid + 1)
            elseif item.itemid == 6262 then
                if Creature.checkCreatureInsideDoor(player, toPosition) then
                    return true
                end
                if item.itemid == 6262 then
                    item:transform(item.itemid - 1)
                    return true
                end
            end
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
    end
    return true
end
hauntedhoused:aid(23151)
hauntedhoused:register()
it doesn't work bro
 
It does not give an error in the console, but the door does not even say the event message, if not this 23:29 The door seems to be sealed against unwanted intruders.
Lua:
local function hasAllStorages(player)
    local storageKeys = {
        Storage.GraveDanger.CobraBastion.DukeKill,
        Storage.GraveDanger.CobraBastion.LordKill,
        Storage.GraveDanger.CobraBastion.TwinsKill,
        Storage.GraveDanger.CobraBastion.VlarkKill,
        Storage.GraveDanger.CobraBastion.EarlKill
    }
    for _, storageKey in pairs(storageKeys) do
        if player:getStorageValue(storageKey) <= 0 then
            return false
        end
    end
    return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not hasAllStorages(player) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
        return true
    end
    if item.itemid == 6261 then
        player:teleportTo(toPosition, true)
        item:transform(item.itemid + 1)
    elseif item.itemid == 6262 then
        if Creature.checkCreatureInsideDoor(player, toPosition) then
            return true
        end
        item:transform(item.itemid - 1)
    end
    return true
end
hauntedhoused:aid(23151)
hauntedhoused:register()
 
Solution
Lua:
local function hasAllStorages(player)
    local storageKeys = {
        Storage.GraveDanger.CobraBastion.DukeKill,
        Storage.GraveDanger.CobraBastion.LordKill,
        Storage.GraveDanger.CobraBastion.TwinsKill,
        Storage.GraveDanger.CobraBastion.VlarkKill,
        Storage.GraveDanger.CobraBastion.EarlKill
    }
    for _, storageKey in pairs(storageKeys) do
        if player:getStorageValue(storageKey) <= 0 then
            return false
        end
    end
    return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not hasAllStorages(player) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
        return true
    end
    if item.itemid == 6261 then
        player:teleportTo(toPosition, true)
        item:transform(item.itemid + 1)
    elseif item.itemid == 6262 then
        if Creature.checkCreatureInsideDoor(player, toPosition) then
            return true
        end
        item:transform(item.itemid - 1)
    end
    return true
end
hauntedhoused:aid(23151)
hauntedhoused:register()
now I can pass freely
 
Back
Top