• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.X+ Action Key tfs 1.5

bpm91

Active Member
Joined
May 23, 2019
Messages
455
Solutions
7
Reaction score
44
Location
Brazil
could someone tell me how I set action on one of the items? ?because here for example there is a key

Lua:
local bagItemId = 1987

local items =

{

{1948, 1},

{2151,2},

{2165,1},

{2091,1}:setActionId(6010)

}
 

Attachments

Solution
@bpm91 try it:

Lua:
local items = {{1948, 1}, {2151, 2}, {2165, 1}}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if player:getStorageValue(8077) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It's empty.")
        return true
    end

    local bagItemId = player:addItem(1987)
    for i = 1, #items do
        bagItemId:addItem(items[i][1], items[i][2])
    end
    local key = bagItemId:addItem(2091, 1)
    if bagItemId then
        key:setActionId(6010)
    end
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a parchment, 2 talons, stealth ring and golden key!")
    player:setStorageValue(8077, 1)
    return true
end

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,245
Solutions
545
Reaction score
4,481
could someone tell me how I set action on one of the items? ?because here for example there is a key

Lua:
local bagItemId = 1987

local items =

{

{1948, 1},

{2151,2},

{2165,1},

{2091,1}:setActionId(6010)

}
Show the full code.

I know exactly which code you are using, but for people to help you effectively (and for future people with the same/similar problem), you need to provide all of the necessary information in this thread.
 
OP
OP
bpm91

bpm91

Active Member
Joined
May 23, 2019
Messages
455
Solutions
7
Reaction score
44
Location
Brazil
local bagItemId = 1987
local items =
{
{1948, 1},
{2151,2},
{2165,1},
setActionId(6010):{2091,1}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(8077) ~= -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 parchment, 2 talons, stealth ring and golden key!")
player:setStorageValue(8077, 1)
return true
end
 

vexler222

Active Member
Joined
Apr 22, 2012
Messages
704
Solutions
15
Reaction score
46
@bpm91 try it:

Lua:
local items = {{1948, 1}, {2151, 2}, {2165, 1}}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if player:getStorageValue(8077) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It's empty.")
        return true
    end

    local bagItemId = player:addItem(1987)
    for i = 1, #items do
        bagItemId:addItem(items[i][1], items[i][2])
    end
    local key = bagItemId:addItem(2091, 1)
    if bagItemId then
        key:setActionId(6010)
    end
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a parchment, 2 talons, stealth ring and golden key!")
    player:setStorageValue(8077, 1)
    return true
end
 
Last edited by a moderator:
Solution

Forkz

Active Member
Joined
Jun 29, 2020
Messages
213
Solutions
1
Reaction score
30
@bpm91 try it:

Lua:
local items = {{1948, 1}, {2151, 2}, {2165, 1}}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if player:getStorageValue(8077) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It's empty.")
        return true
    end

    local bagItemId = player:addItem(1987)
    for i = 1, #items do
        bagItemId:addItem(items[i][1], items[i][2])
    end
    local key = bagItemId:addItem(2091, 1)
    if bagItemId then
        key:setActionId(6010)
    end
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a parchment, 2 talons, stealth ring and golden key!")
    player:setStorageValue(8077, 1)
    return true
end
Congratulations on your answer!
 
Last edited by a moderator:
OP
OP
bpm91

bpm91

Active Member
Joined
May 23, 2019
Messages
455
Solutions
7
Reaction score
44
Location
Brazil
unfortunately I was absent from the community for a while, because I had personal problems, I don't even remember where I stopped, answering the knight, I'm not a scripter, I'm an administrator, that is, either I pay to do the services or I can very well ask for help.
I will now check this action and I will test it.
however knight, I don't do lazy and poorly done jobs to take money from others by making me a "professional" spriter ctrl c ctrl v
Post automatically merged:

@bpm91 try it:

Lua:
local items = {{1948, 1}, {2151, 2}, {2165, 1}}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if player:getStorageValue(8077) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It's empty.")
        return true
    end

    local bagItemId = player:addItem(1987)
    for i = 1, #items do
        bagItemId:addItem(items[i][1], items[i][2])
    end
    local key = bagItemId:addItem(2091, 1)
    if bagItemId then
        key:setActionId(6010)
    end
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a parchment, 2 talons, stealth ring and golden key!")
    player:setStorageValue(8077, 1)
    return true
end



A tfu spamer, OTS community die every year, And you writing stupid spam messages.. instead help to ppl who try do something, makeing new ots.. A TFU
Ty vexler work 100%, ty xikini for answer
 
Last edited:
Top