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

Switch to buy runes (Problem)

SpekkarN

New Member
Joined
Aug 23, 2009
Messages
73
Reaction score
0
I have problems on my server when you pull the switch you get a bps of sds,payalyze and so on, But when i drag pull to ultimate healing runes nothing happens:/ The switch just move to the other side:/ The switches that works stay on same place when you click on them.

a21.jpg

And here is the code, I have set id on the switch to 1254 in Rme mapeditor, So can anyone see the problem? Rep+ if someone help.
Code:
  --[[
        Runes Script v1.3
        by Shawak, Sherlok & Renusek
]]--

local config = {
        [1248] = {potion = 2268, cost = 3000, backpack_id = 2003, charges = 15}, -- sudden death rune
        [1249] = {potion = 2269, cost = 3400, backpack_id = 2002, charges = 15}, -- wild growth rune
        [1250] = {potion = 2274, cost = 3600, backpack_id = 2002, charges = 15}, -- avalanche rune
        [1251] = {potion = 2305, cost = 7000, backpack_id = 2000, charges = 2}, -- fire bomb rune
        [1253] = {potion = 2278, cost = 14000, backpack_id = 5949, charges = 15}, -- paralyze rune
        [1255] = {potion = 2261, cost = 900, backpack_id = 2003, charges = 15}, -- destroy field rune
        [1256] = {potion = 2293, cost = 7000, backpack_id = 2004, charges = 15}, -- magic wall rune
	[1254] = {potion = 2273, cost = 3000, backpack_id = 2002, charges = 15}, -- ultimate healing rune
} -- config end --

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local potion = config[item.uid]
        if isInArray({1945, 1946}, item.itemid) ~= TRUE then
                return TRUE
        end
        if doPlayerBuyItemContainer(cid, potion.backpack_id, potion.potion, 1, potion.cost, potion.charges) == TRUE then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a backpack "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a backpack "..getItemNameById(potion.potion)..".")
        end
        return TRUE
end
 
The script is configured to use Unique IDs. Also, there are some things that might prevent it from working on TFS 0.3, if you're using it.
 
Add this too :)
PHP:
   if getPlayerFreeCap(cid) >= weight then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot buy this, it is too heavy.")
      return true
   end
 
Back
Top