• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action [LEVER] Donate shop ingame *HOT*

Just making something fast,

Lua:
local t = {
[1938] = {1,"arcane staff",2453},
[1939] = {1,"magic plate armor",2472},
}
 
function onUse(cid,item,fromPosition,itemEx,toPosition)
local v = t[item.uid]
      if doPlayerRemoveItem(cid, 6527, v[1]) and getPlayerFreeCap(cid) >= (getItemWeightById(v[3])) then
               doPlayerAddItem(cid,v[3])
               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have buy a " .. v[2] .. " for "..v[1].." christmas token(s)!")
         else
               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need atleast "..v[1].." christmas token(s) to buy "..getItemNameById(v[3]).."!")
                 end
     return true
end
 
Sorry i need help!!

Lua:
[21/3/2013 13:8:38] [Error - Action Interface] 
[21/3/2013 13:8:38] data/actions/scripts/donateshop.lua:onUse
[21/3/2013 13:8:38] Description: 
[21/3/2013 13:8:38] data/actions/scripts/donateshop.lua:23: attempt to index local 'v' (a nil value)
[21/3/2013 13:8:38] stack traceback:
[21/3/2013 13:8:38] 	data/actions/scripts/donateshop.lua:23: in function <data/actions/scripts/donateshop.lua:21>
 
Nice script I will have to try it when I get my next OT running.
 
Back
Top Bottom