• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Conjure Runes on Backpack

just check player for blank runes and if they have 1 or 2 then remove and give new ones
or you could iterate through backpack recursively to find all blanks and transform
 
Code:
local function conjure(cid, id, c)
    doPlayerRemoveItem(cid, blankruneid)
    doPlayerGiveItem(cid, blankruneid)
    if c and c == 2 then
        conjure(cid, id)
    end
end

local blanks = getPlayerItemCount(cid, blankruneid)
if blanks == 0 then
    return false
end
conjure(cid, blankruneid, (blanks >= 2) and 2 or 1)

or transform way (recursive backpack search)
Code:
local function searchbp(uid, t)
    local t = t or {}
    for slot = getContainerSize(uid)-1, 1 do
        local item = getContainerItem(uid, slot)
        if isContainer(item) then
             searchbp(item, t)
        else
             t[#t+1] = item
        end
    end
end

local function conjure(t, blank, subtype)
    local amt = (#t >= 2) and 2 or 1
    if #t < amt then
        return print('Amount is higher than maximum key value of rune table')
    end
    for i = 1, amt do
        doTransformItem(t[i], blank, subtype)
    end
end
 
Last edited:
Back
Top