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

upgrade script

rooyo

New Member
Joined
Jul 2, 2013
Messages
70
Reaction score
3
hello I need someone who will improve the script 0.3.6

Code:
function onSay(cid, words, param, channel)

local monsterFile = "data/lootinfo/" .. param .. ".xml"
local loot = {}
local t = 0
local text = "File opened: " .. monsterFile .. ""

    if (io.open(monsterFile, "r") ~= nil) then
    for line in io.lines(monsterFile) do
        if (line:find('id=".*".*')) then
            line = string.match(line, 'id=".*".*')
            lootid = string.sub(line, string.find(line, '="') + 2, string.find(line, '" ') - 1)
            table.insert(loot, lootid)
        end
    end
    text = text .. "\n\n" .. "Found " .. #loot .. " items\n"
    for _, i in ipairs(loot) do
        t = t + 1
        text = text .. "\n " .. t .. ". " .. getItemArticleById(i) .. " " .. getItemNameById(i) .. " [" .. i .. "]"
    end
        doPlayerPopupFYI(cid, text)
        return TRUE
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "File: " .. monsterFile .. " does not exist.")
        return TRUE
    end
    return TRUE
end


information needed chance for loot displayed in% and hiding xml file location
 
Back
Top