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

console error on tile.lua

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
I got this error i recently paste the goblet part from other datapack but i screwed up

2h5ryg5.png

i know its something about i recently added but exactly i dont know where to put it
Heres the script

Code:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000



function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
        return true
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end
   
    if isInArray(GobletTiles, item.actionid) then
    local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end
    return true
end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
   
   
    return true
end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end
    return true
end


function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end
 
now this
2n6r7g9.png


Code:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000

if isInArray(GobletTiles, item.actionid) then
    local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end
   
    return true
end

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
        return true
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end
    return true
end

function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end
 
No problem. I'm happy to help. :)

Edit: The whole "if isInArray" function you added is in the wrong place.

Dang, now this :(
z4wux.png


Code:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000
return true

if isInArray(GobletTiles, item.actionid) then
    local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    return true
end

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end
    return true
end

function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end
 
Last edited:
Dang, now this :(
z4wux.png


Code:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000
return true

if isInArray(GobletTiles, item.actionid) then
    local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    return true
end

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end
    return true
end

function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end
Line 4, remove the return true
lines 6 - 17, this if statement needs to be placed inside your main functions, or you need to make it into a function and reference it inside your main functions.
 
How i do that?
no one would know but you, depends on what you got your script from
if it's originally like that then good luck cause the script maker made it all spaghetti
6-17 belong in a function of their own, judging myself i'd say it looks like it belongs in an action script but i'm not sure
 
no one would know but you, depends on what you got your script from
if it's originally like that then good luck cause the script maker made it all spaghetti
6-17 belong in a function of their own, judging myself i'd say it looks like it belongs in an action script but i'm not sure

6-17 i copied from other tiles script hoping it would work on mine, here is where i copied from.

Code:
local increasingItemID = {416, 446, 3216, 11062}
local decreasingItemID = {417, 447, 3217, 11063}

function onStepIn(cid, item, position, fromPosition)
    if isInArray(increasingItemID, item.itemid) then
        doTransformItem(item.uid, item.itemid + 1)
        if item.actionid > 1000 and item.actionid < 2000 then
            getLevelTile(cid, item, position)
        else --if getTilePzInfo(position) then
            getDepotItems(cid, position)
        end
    elseif item.itemid == 426 then
        doTransformItem(item.uid, 425)
        if item.actionid > 1000 and item.actionid < 2000 then
            getLevelTile(cid, item, position)
        else --if getTilePzInfo(position) then
            getDepotItems(cid, position)
        end
    end
   
    if isInArray(GobletTiles, item.actionid) then
    local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end
   
    return true
end

function onStepOut(cid, item, position, fromPosition)
    if isInArray(decreasingItemID, item.itemid) then
        doTransformItem(item.uid, item.itemid - 1)
    elseif item.itemid == 425 then
        doTransformItem(item.uid, item.itemid + 1)
    end
    return true
end

function getLevelTile(cid, item, position)
    local player = Player(cid)
    if player == nil then
        return
    end

    if player:getLevel() < item.actionid - 1000 then
        local playerPosition = player:getPosition()
        doTeleportThing(cid, {x = playerPosition.x, y = playerPosition.y, z = playerPosition.z + 1})
        playerPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    end
end

function getDepotItems(cid, position)
    local player = Player(cid)
    if player == nil then
        return
    end

    local possiblePositions = {
        {x = position.x - 1, y = position.y, z = position.z},
        {x = position.x + 1, y = position.y, z = position.z},
        {x = position.x, y = position.y - 1, z = position.z},
        {x = position.x, y = position.y + 1, z = position.z},
    }

    for i = 1, #possiblePositions do
        local tile = Tile(possiblePositions[i])
        if tile ~= nil then
            local item = tile:getItemByType(ITEM_TYPE_DEPOT)
            if item ~= nil then
                local depotItems = player:getDepotItems(getDepotId(item:getUniqueId()))
                if depotItems == 1 then
                    player:sendTextMessage(MESSAGE_EVENT_DEFAULT, 'Your depot contains 1 item.')
                else
                    player:sendTextMessage(MESSAGE_EVENT_DEFAULT, 'Your depot contains '  .. depotItems .. ' items.')
                end
                break
            end
        end
    end
end
 
I fell asleep and forgot to check back, my bad. :p You may be better off telling us exactly what you want at this point, and then maybe someone can create a script for you. Just let us know what you want to accomplish.
 
I just moved the scripts for barbarian arena from a server i downloaded, to my server.
Everything works fine, problem is when you step on the tile, that will give you the goblet with your name, it doesnt work.
So i check if i missed something, tiles.lua grabs my atention and vuala there is something about the goblet part (line 6-17/ that i dont have in my tiles.lua script

so i just copy it and paste it in my original tiles.lua so i screwed up hehe
 
Rule No. 1 of scripting - TAB YOUR SCRIPTS
Even if you are making or downloading a 3 liner script - always tab it.
It makes it a billion times easier to find the error in the script, no matter what.

Give this a try;
LUA:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
        return true
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if isInArray(GobletTiles, item.actionid) then
        local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
        return true
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end

    return true
end


function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end

If you get any errors take an SS of the console and post them.
 
Rule No. 1 of scripting - TAB YOUR SCRIPTS
Even if you are making or downloading a 3 liner script - always tab it.
It makes it a billion times easier to find the error in the script, no matter what.

Give this a try;
LUA:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
        return true
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if isInArray(GobletTiles, item.actionid) then
        local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
        return true
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end

    return true
end


function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end

If you get any errors take an SS of the console and post them.

Thanks, i got this, when i step on the goblet tile on barbarian arena reward room
2iqe5gk.png
 
Thanks, i got this, when i step on the goblet tile on barbarian arena reward room
2iqe5gk.png

Run this script and take another SS;
LUA:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000

function onStepIn(creature, item, position, fromPosition)
    if not increasing[item.itemid] then
        return true
    end

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    item:transform(increasing[item.itemid])

    if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
        if player:getLevel() < item.actionid - 1000 then
            player:teleportTo(fromPosition, false)
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        end
        return true
    end

    if isInArray(GobletTiles, item.actionid) then
        local gobletPos = getThingPos(item.uid)
        if getPlayerStorageValue(cid, item.actionid) ~= 1 then
            setPlayerStorageValue(cid, item.actionid, 1)
            goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
            print("1", goblet)
            print("2", Goblets[item.actionid])
            doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
            gobletPos.y = gobletPos.y - 1
            doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
            doTileAddItemEx(gobletPos, goblet)
        end
    end

    if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
        local lookPosition = player:getPosition()
        lookPosition:getNextPosition(player:getDirection())
        local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
        if depotItem ~= nil then
            local depotItems = 0
            for i = 1, 17 do
                depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
            end
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
            return true
        end
        return true
    end

    if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
        player:teleportTo(fromPosition, false)
        position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
        return true
    end

    return true
end


function onStepOut(creature, item, position, fromPosition)
    if not decreasing[item.itemid] then
        return true
    end

    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    item:transform(decreasing[item.itemid])
    return true
end
 
2cr3w51.png


got this error while stepping the goblet tile

Okay and can you try and find the rest of the variables?
Might be in global.lua or some other lib file;
GobletTiles
Goblets

Can you also check your own script what is on line 34, should be one of these;
LUA:
doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
gobletPos.y = gobletPos.y - 1
 
Okay and can you try and find the rest of the variables?
Might be in global.lua or some other lib file;
GobletTiles
Goblets

Can you also check your own script what is on line 34, should be one of these;
LUA:
doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
gobletPos.y = gobletPos.y - 1

I got that already on line 34
I just reemplaced the tiles.lua, from the datapack i import the arena scripts, and its working.

But then a new error from other thing is poping i cant logout hehe
I think the function on getstorage is wrong am i right?
Im using tfs1.2 must be diferrent but i dont know how
23qk3d.jpg

Heres the script
Code:
function onLogout(cid)
    if getCreatureStorage(cid, oakStorages.treeCut) > 0 and getCreatureStorage(cid, oakStorages.done) < 1 then
        doCreatureSetStorage(cid, oakStorages.treeCut, 0)
    end
    return true
end
 
Back
Top