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

Scripters welcome. Lever Script

Eraser

Hoster
Joined
Jul 20, 2007
Messages
29
Reaction score
0
Location
Muntlix (Austria)
Hej to all, i need an Lever script.
If i use a lever, ill get the item which is under the lever, btw. everytime i use the lever i have to pay a prize.

Example1: 1 Lever Use = 800 Gold = Backpack of Manafluid
Example2: 1 Lever Use = 1500 Gold = Backpack of Sudden Death Runes

Could some1 help me with my problems?
Thx 4 now. I hope some1 can help me.
 
PHP:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 1500
	if getPlayerMoney(cid) >= cost then
			if getPlayerFreeCap(cid) >= 54 then
		doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 3) -- Gives Gray BP to player, with 20 SD runes, each with 3 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for "..cost.." gold pieces.")
		return 1
		else
	doPlayerSendCancel(cid,'You need '..cost..' gold pieces to buy this item.')
end
	else
	doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potion
local cost = 800
	if getPlayerMoney(cid) >= cost then
		if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for "..cost.." gold pieces.")
		else
	doPlayerSendCancel(cid,'You need '..cost..' gold pieces to buy this item.')
end
	else
	doPlayerSendCancel(cid,'You need more capacity.')
	end
		return 1
	end
end
 
Last edited:
PHP:
functon onUse(cid, item, fromPosition, itemEx, toPosition)
     local reward = 1337 -- item id
     local price = 800 -- gps

     if item.itemid == 1945 then
          if doPlayerRemoveMoney(cid, price) == TRUE then
               doPlayerAddItem(cid, reward, 1)
               doPlayerSendTextMessage(cid, 24, "You recieved a " .. getItemNameById(reward) .. ".")
          else
               doPlayerSendCancel(cid, "You do not have the required " .. price .. "gps.")
          end
          doTransform(item.uid, 1946)
     elseif item.itemid == 1946 then
          doTransform(item.uid, 1945)
     end
end
 
error

Ive got an error in my script, ive done something wrong with adding things.
I think so.

heres the script

Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, 10000, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for "10000" gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, 1000, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for "1000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, 2000, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for "2000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, 3000, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for "3000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, 1000, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for "1000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, 2000, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for "2000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, 3000, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for "3000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, 1000, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for "1000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, 2000, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for "2000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, 3000, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for "3000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, 4000, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for "4000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '4000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end

whats wrong with it??

thats the error of my console.

[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:51] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[05/01/2009 23:51:51] data/actions/scripts/lever/lever.lua:7: ')' expected near '10000'
[05/01/2009 23:51:52] Reloaded actions.
 
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, 10000, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for '10000' gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, 1000, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for "1000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, 2000, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for "2000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, 3000, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for "3000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, 1000, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for "1000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, 2000, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for "2000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, 3000, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for "3000" gold pieces.")
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, 1000, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for "1000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '1000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, 2000, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for "2000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '2000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, 3000, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for "3000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '3000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, 4000, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for "4000" gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need '4000' gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end
 
hmm, i dont know whats wrong now, but i get this error now, :P

[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
[06/01/2009 00:33:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 00:33:50] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'

,btw what do i have to write in actions.xml, maybe ive got an error there
 
Add an 'end' below this line 'doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')'.
 
Code:
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, 10000, 10) -- Gives Gray 
        end
BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for "10000" gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')
end
how do u mean? xD am i right?
 
Code:
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, 10000, 10) -- Gives Gray 
        end
BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for "10000" gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')
end
how do u mean? xD am i right?


If thats not correct, Try this one, If im wrong correct me!

Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, 10000, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for '10000' gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need '10000' gold pieces to buy this item.')
	end
end


Sorry for taking it here, but im wondring the new id for the GM outfit, the green cape, for 8.4 tfs 0.2
Thanks
 
PHP:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 1500
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 3) -- Gives Gray BP to player, with 20 SD runes, each with 3 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for 1500 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 1500 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potion
local cost = 800
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for "..cost.." gold pieces.")
        else
    doPlayerSendCancel(cid,"You need 800 gold pieces to buy this item.")
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
    end
        return 1
    end
end

And you weren't supposed to change '..cost..' to number, it didn't work beacause of " ' "
if you want to use " ' ", place "\" before it, ex:
PHP:
    doPlayerSendCancel(cid,'You need \'800\' gold pieces to buy this item.")
or just use the text with quotation marks:
PHP:
    doPlayerSendCancel(cid,"You need '800' gold pieces to buy this item.")
 
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for 10000 gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need 10000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, cost, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, cost, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, cost, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, cost, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, cost, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, cost, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for 1000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, cost, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for 2000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, cost, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for 3000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, cost, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for 4000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 4000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end
ok ive done that now, but now this error appears :S
[06/01/2009 01:16:27] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 01:16:27] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'

and what to write in actions.xml???
 
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for 10000 gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need 10000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
        return 1
end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, cost, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, cost, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, cost, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, cost, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, cost, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, cost, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for 1000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, cost, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for 2000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, cost, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for 3000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, cost, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for 4000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 4000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end
ok ive done that now, but now this error appears :S
[06/01/2009 01:16:27] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lever/lever.lua
[06/01/2009 01:16:27] data/actions/scripts/lever/lever.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'

and what to write in actions.xml???
im not sure but test this
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for 10000 gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need 10000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, cost, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, cost, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, cost, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, cost, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, cost, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, cost, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for 1000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, cost, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for 2000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, cost, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for 3000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, cost, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for 4000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 4000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end
 
im not sure but test this
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 21000 then -- BP SD
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2003, 2268, 1, cost, 10) -- Gives Gray BP to player, with 20 SD runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Sudden Death Runes for 10000 gold pieces.")
        else
        return 1
    doPlayerSendCancel(cid,'You need 10000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21001 then -- BP Mana Potions
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7620, 1, cost, 0) -- Gives Purple BP to player, with 20 mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Mana Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21002 then -- BP Strong Mana Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7589, 1, cost, 0) -- Gives Purple BP to player, with 20 strong mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Mana Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21003 then -- BP Great Mana Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2001, 7590, 1, cost, 0) -- Gives Purple BP to player, with 20 great mana potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Mana Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21004 then -- BP Health Potion
local cost = 1000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7618, 1, cost, 0) -- Gives Red BP to player, with 20 health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Health Potions for 1000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21005 then -- BP Strong Health Potion
local cost = 2000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7588, 1, cost, 0) -- Gives Red BP to player, with 20 strong health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Strong Health Potions for 2000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')
end
elseif item.actionid == 21006 then -- BP Great Health Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
        if getPlayerFreeCap(cid) >= 54 then
doPlayerBuyItemContainer(cid, 2000, 7591, 1, cost, 0) -- Gives Red BP to player, with 20 great health potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Health Potions for 3000 gold pieces.")
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21007 then -- BP Magic Wall Rune
local cost = 10000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 1999, 2293, 1, cost, 10) -- Gives yellow BP to player, with 20 MW runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Magic Wall Runes for 1000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 1000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21008 then -- BP Ultimate Healing Rune
local cost = 2000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 2273, 1, cost, 10) -- Gives blue BP to player, with 20 UH runes, each with 10 charges
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Runes for 2000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 2000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21009 then -- BP Great Spirit Potion
local cost = 3000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2002, 8472, 1, cost, 0) -- Gives blue BP to player, with 20 great spirit potions
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Great Spirit Potions for 3000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 3000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
elseif item.actionid == 21010 then -- BP Ultimate Healing Potion
local cost = 4000
    if getPlayerMoney(cid) >= cost then
            if getPlayerFreeCap(cid) >= 54 then
        doPlayerBuyItemContainer(cid, 2000, 8473, 1, cost, 10) -- Gives red BP to player, with 20 ultimate healing potion
             doPlayerSendTextMessage(cid, 24, "You bought a backpack of Ultimate Healing Potions for 4000 gold pieces.")
        return 1
        else
    doPlayerSendCancel(cid,'You need 4000 gold pieces to buy this item.')
end
    else
    doPlayerSendCancel(cid,'You need more capacity.')

end
        return 1
    end
end



Sorry,dude,it didnt work for me. using tfs 0.2


EDIT : i forgot post the error's
[06/01/2009 16:37:04] Warning: [Event::loadScript] Can not load script. data/actions/scripts/tools/buyrunes.lua
[06/01/2009 16:37:04] data/actions/scripts/tools/buyrunes.lua:10: 'end' expected (to close 'if' at line 5) near 'doPlayerSendCancel'
 
Back
Top