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

TalkAction Own Loot Backpack - Tfs 1.x

HeberPcL

[PowerOT.com.br]
Joined
Aug 21, 2007
Messages
1,292
Reaction score
51
Location
Brazil
GitHub
heberpcl
Hello,
remaker script for tfs 1.x.

by @Azi
https://otland.net/threads/own-loot-backpack.14923/

talkactions.xml
Code:
<talkaction words="!ownbp" script="ownbp.lua"/>
ownbp.lua
Code:
local config = {
    cost = 1000, -- Cost (GP)
    ownTime = 24 * 60 * 60 * 1000, -- Time (24 horas)
    backpackId = 2000
}

function onSay(player, words, param)
    local playerID = player:getGuid()
    local owner = (playerID + 100)
    local ownerName = player:getName()

    local function noOwner(o)
        o:removeAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
        o:setActionId(0)
    end

    if (player:removeMoney(config.cost) == true) then
        local backpack = doPlayerAddItem(player:getId(), config.backpackId, 1)
        if (backpack ~= nil) then
            doSetItemSpecialDescription(backpack, ownerName..' owns this container.')
            doSetItemActionId(backpack, owner)
            addEvent(noOwner, 1000 * config.ownTime, backpack)
        end
    else
        doPlayerSendCancel(cid, "You do not have the amount of GP ("..config.cost..").")
    end
end

actions.xml
Code:
<action itemid="2000" script="ownbp.lua"/>

ownbp.lua
Code:
function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
    local playerID = cid:getGuid() -- getPlayerGUID(cid)
    local owner = (item.actionid - 100)
    if (owner > 0) then
        if (owner ~= playerID) then
            doPlayerSendCancel(cid, "You aren\'t owner of this container.")
            return TRUE
        end
    end
end
 
Last edited:
I'm running TFS 1.2 and the script will not process the mathematics in (playerID + 100) or in (item.actionid -100) so anyone can open the bag with no error in the server. Any ideas?
 
I'm running TFS 1.2 and the script will not process the mathematics in (playerID + 100) or in (item.actionid -100) so anyone can open the bag with no error in the server. Any ideas?

No replies on this? Did anyone else get it to work successfully on TFS 1.2?
 
I LOVE YOU :D

I LOVE YOU :D

addEvent(noOwner, 1000 * config.ownTime, backpack)

Erro: no remov o TIME :( erro no TIME

Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/talkactions/scripts/otfacil/ownbp.lua:13: attempt to index local 'o' (a number value)
stack traceback:
[C]: in function '__index'
data/talkactions/scripts/otfacil/ownbp.lua:13: in function <data/talkactions/scripts/otfacil/ownbp.lua:12>
 
Last edited by a moderator:
Back
Top