Darqneez
ShaC-Ohhhh
Hello, I'm not good at lua so I please pro scripters from otland.net to change this script:
local items = {
[6006] = {cost = 3800, item_id = 7591, item_id_count = 1, count = 20, bp_id = 2000, drop = false}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local actual = items[item.uid]
if actual ~= nil then
if getPlayerMoney(cid) >= actual.cost then
local new_container = doCreateItemEx(actual.bp_id, 1)
for i = 1, actual.count do
doAddContainerItem(new_container, actual.item_id, actual.item_id_count)
end
local itms = doPlayerAddItemEx(cid, new_container, actual.drop)
if itms == 1 then
doPlayerRemoveMoney(cid, actual.cost)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "I bought a backpack filled with "..getItemNameById(actual.item_id))
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somehow faint")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Ohh this is too expensive")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Oh something is not worked")
end
return TRUE
end
to script, which works very similiar. I just want to obtain a normal rune with 99 stacks from lever. I don't need backpack, just 1 rune, I hope you understand me
local items = {
[6006] = {cost = 3800, item_id = 7591, item_id_count = 1, count = 20, bp_id = 2000, drop = false}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local actual = items[item.uid]
if actual ~= nil then
if getPlayerMoney(cid) >= actual.cost then
local new_container = doCreateItemEx(actual.bp_id, 1)
for i = 1, actual.count do
doAddContainerItem(new_container, actual.item_id, actual.item_id_count)
end
local itms = doPlayerAddItemEx(cid, new_container, actual.drop)
if itms == 1 then
doPlayerRemoveMoney(cid, actual.cost)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "I bought a backpack filled with "..getItemNameById(actual.item_id))
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somehow faint")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Ohh this is too expensive")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Oh something is not worked")
end
return TRUE
end
to script, which works very similiar. I just want to obtain a normal rune with 99 stacks from lever. I don't need backpack, just 1 rune, I hope you understand me