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

Port Script TFS 0.4 for TFS 1.3

adriez

New Member
Joined
Aug 14, 2011
Messages
73
Reaction score
1
any port ?? he script, only the vocation of the item, takes the same

local vocQ = {

["1-5"] = {item = {7365, itemid}},
["2-6"] = {item = {7365, itemid}},
["3-7"] = {item = {7365, itemid}},
["4-8"] = {item = {7365, itemid}},

}

function onUse(cid, item, toPosition, itemEx, fromPosition)

if getPlayerStorageValue(cid, 7365) ~= 1 then
for voc, items in pairs(vocQ) do
local v = string.explode(voc, "-")
if getPlayerVocation(cid) == tonumber(v[1]) or getPlayerVocation(cid) == tonumber(v[2]) then
doPlayerAddItem(cid, items.item[1], 1)
doPlayerAddItem(cid, items.item[2], 1)
doPlayerSendTextMessage(cid, 25, "Congratulations!!")
doPlayerSetStorageValue(cid, 7365, 1)
break
end
end
else
doPlayerSendCancel(cid, "It's empty.")
end
return true
end
 
Lua:
local vocQ = {
    ["1-5"] = {item = {7365, 7365}},
    ["2-6"] = {item = {7365, 7365}},
    ["3-7"] = {item = {7365, 7365}},
    ["4-8"] = {item = {7365, 7365}},
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7365) ~= 1 then
        local vid = player:getVocation():getId()
        for voc, items in pairs(vocQ) do
            local v = string.explode(voc, "-")
            if vid == tonumber(v[1]) or vid == tonumber(v[2]) then
                player:addItem(items.item[1], 1)
                player:addItem(items.item[2], 1)
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations!!")
                player:setStorageValue(7365, 1)
                break
            end
        end
    else
        player:sendCancelMessage("It's empty.")
    end
    return true
end
 
attempt to call field 'explode' (a nil value)
stack traceback:
[C]: in function 'explode'
data/actions/scripts/quests/Super Flecha.lua:12: in function <data/actions/scripts/quests/Super Flecha.lua:8>


Lua:
local vocQ = {
    ["1-5"] = {item = {7365, 7365}},
    ["2-6"] = {item = {7365, 7365}},
    ["3-7"] = {item = {7365, 7365}},
    ["4-8"] = {item = {7365, 7365}},
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7365) ~= 1 then
        local vid = player:getVocation():getId()
        for voc, items in pairs(vocQ) do
            local v = string.explode(voc, "-")
            if vid == tonumber(v[1]) or vid == tonumber(v[2]) then
                player:addItem(items.item[1], 1)
                player:addItem(items.item[2], 1)
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations!!")
                player:setStorageValue(7365, 1)
                break
            end
        end
    else
        player:sendCancelMessage("It's empty.")
    end
    return true
end
 
Lua:
local vocQ = {
    [{1,5}] = {item = {7365, 7365}},
    [{2,6}] = {item = {7365, 7365}},
    [{3,7}] = {item = {7365, 7365}},
    [{4,8}] = {item = {7365, 7365}},
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7365) ~= 1 then
        local vid = player:getVocation():getId()
        for voc, items in pairs(vocQ) do
            if vid == voc[1] or vid == voc[2] then
                player:addItem(items.item[1], 1)
                player:addItem(items.item[2], 1)
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations!!")
                player:setStorageValue(7365, 1)
                break
            end
        end
    else
        player:sendCancelMessage("It's empty.")
    end
    return true
end
 
Lua:
local vocQ = {
    [{1,5}] = {item = {7365, 7365}},
    [{2,6}] = {item = {7365, 7365}},
    [{3,7}] = {item = {7365, 7365}},
    [{4,8}] = {item = {7365, 7365}},
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(7365) ~= 1 then
        local vid = player:getVocation():getId()
        for voc, items in pairs(vocQ) do
            if vid == voc[1] or vid == voc[2] then
                player:addItem(items.item[1], 1)
                player:addItem(items.item[2], 1)
                player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Congratulations!!")
                player:setStorageValue(7365, 1)
                break
            end
        end
    else
        player:sendCancelMessage("It's empty.")
    end
    return true
end

why does it add two arrows?
 
Back
Top