• 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+ tfs 1.5 nekiro add bag in action

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
hello, i'm new with this version of tfs and i would like to know how do i add a bag with items inside?

LUA:
function onUse(cid, item, frompos, item2, topos)
    if getPlayerStorageValue(cid, 4000) == -1 then
        if getPlayerFreeCap(cid) >= 68 then
        doPlayerAddItem(cid,2545,7)
        doPlayerAddItem(cid,2006,7,1)
        doPlayerAddItem(cid,2006,10,1)
        doPlayerAddItem(cid,2148,12)
        setPlayerStorageValue(cid,4000,1)
        doPlayerSendTextMessage(cid,22,"You have found a bow, manafluid, lifefluid, 7 poison arrow and 12 gold coins!")
        else
        doPlayerSendTextMessage(cid,22,"You need capacity!")
    end
    else
    doPlayerSendTextMessage(cid,22,"It's empty.")
    end
return TRUE
end
 
Solution
X
I don't think you included the bow in the list of added items tho.
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(4000) ~= -1 then
        player:sendCancelMessage("It's empty.")
        return true
    end
    
    local bag = Game.createItem(1987, 1)
    bag:addItem(2545, 7)
    bag:addItem(2006, 7, 1)
    bag:addItem(2006, 10, 1)
    bag:addItem(2148, 12)
    
    if player:getFreeCapacity() < bag:getWeight() then
        player:sendCancelMessage("You need capacity!")
        return true
    end
    
    if not player:addItemEx(bag) then
        player:sendCancelMessage("You need inventory!")
        return true
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You...
I don't think you included the bow in the list of added items tho.
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(4000) ~= -1 then
        player:sendCancelMessage("It's empty.")
        return true
    end
    
    local bag = Game.createItem(1987, 1)
    bag:addItem(2545, 7)
    bag:addItem(2006, 7, 1)
    bag:addItem(2006, 10, 1)
    bag:addItem(2148, 12)
    
    if player:getFreeCapacity() < bag:getWeight() then
        player:sendCancelMessage("You need capacity!")
        return true
    end
    
    if not player:addItemEx(bag) then
        player:sendCancelMessage("You need inventory!")
        return true
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bow, manafluid, lifefluid, 7 poison arrow and 12 gold coins!")
    player:setStorageValue(4000, 1)
    return true
end
 
Solution
player:sendTextMessage(cid,22,"It's empty.")
It would be like this?
actually all the messages are coming in white i wanted to change the colors to green
I'm a tfs 0.4 amateur getting 1.5 now :/
 
player:sendTextMessage(cid,22,"It's empty.")
It would be like this?
actually all the messages are coming in white i wanted to change the colors to green
I'm a tfs 0.4 amateur getting 1.5 now :/
there you go
LUA:
  player:sendTextMessage(MESSAGE_INFO_DESCR, "YOURTEXT!")
 
local bag = Game.createItem(1987, 1)
bag:addItem(2209,1)
bag:addItem(2199,1)
bag:addItem(2088,1)
if item(2088) then
key:setActionId(3667)

how can i set a key inside the bag with an action just for it?


bag:addItem(2088,1):setActionId(3600)
work xD
 
Last edited:
Back
Top