Darqneez
ShaC-Ohhhh
hello, I'd like to change this script made by wesoly136
I tried to make my own script but it doesnt work. Can someone help me? Here's my not working script:
to script which creates a backpack filled with potions.local rune = {cost = 6500, item_id = 2268, item_id_count = 100, count = 1, drop = false}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMoney(cid) >= rune.cost then
if doPlayerAddItem(cid, rune.item_id,rune.item_id_count,false) then
doPlayerRemoveMoney(cid, rune.cost)
doPlayerAddItem(cid, rune.item_id,rune.item_id_count,false)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought a sudden death rune.")
else
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You don\'t have enough container")
end
else
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You don\'t have enough money")
end
end
I tried to make my own script but it doesnt work. Can someone help me? Here's my not working script:
local rune = {cost = 3800, item_id = 7591, item_id_count = 1, count = 20, drop = false, bp_id = 2000}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMoney(cid) >= rune.cost then
local new_container = doCreateItemEx(cid, rune.bp_id, 1)
if doAddContainerItem(new_container, rune.item_id,rune.item_id_count,false) then
doPlayerRemoveMoney(cid, rune.cost)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought backpack filled with great health potions.")
else
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You don\'t have enough capacity")
end
else
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You don\'t have enough money")
end
end