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

TFS 1.X+ action item tfs 1.5

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
hello, I'm having problems, my script ignores the inventory and the capacity, and then they don't work, so it says I took it but it doesn't fall on the floor, and it doesn't come to the character either, so when I click again it's empty because the storage already been given

LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7475) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR,"It's empty.")
        return true
    end
   
    local bag = Game.createItem(5460, 1)
    bag:addItem(2152, 10)
   
    if player:getFreeCapacity() < bag:getWeight() then
        player:sendTextMessage(MESSAGE_INFO_DESCR,"You need capacity!")
        return true
    end
   
    if not player:addItemEx(bag) then
        player:sendTextMessage(MESSAGE_INFO_DESCR,"You need inventory!")
        return true
    end

    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a Fur Backpack!")
    player:setStorageValue(7475, 1)
    return true
end
 
Last edited:
Solution
X
does anyone know how to fix it or have a script that when opening a chest comes a backpack with an item inside?

LUA:
player:giveItems(itemTable[, containerId[, canDropOnGround = false]])
LUA:
local bagItemId = 5460
local items = {
    {2152, 10}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7475) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR,"It's empty.")
        return true
    end
   
    if not player:giveItems(items, bagItemId, false) then
        return true
    end

    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a Fur Backpack!")...
does anyone know how to fix it or have a script that when opening a chest comes a backpack with an item inside?

LUA:
player:giveItems(itemTable[, containerId[, canDropOnGround = false]])
LUA:
local bagItemId = 5460
local items = {
    {2152, 10}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7475) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR,"It's empty.")
        return true
    end
   
    if not player:giveItems(items, bagItemId, false) then
        return true
    end

    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a Fur Backpack!")
    player:setStorageValue(7475, 1)
    return true
end
 
Solution
ty xikini, i love u <3
Post automatically merged:

could someone tell me how I set action on one of the items? ?because here for example there is a key
local bagItemId = 1987
local items =
{
{1948, 1},
{2151,2},
{2165,1},
{2091,1}:setActionId(6010)
}
1657852688083.png
 
Last edited:

Similar threads

Back
Top