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

Buy items by lever

oliverpadron86

New Member
Joined
Mar 1, 2018
Messages
40
Reaction score
0
Hi everyone im looking for a script to buy items by lever
Im using crying damnson server 0.3.6
 
Add the following script in action/scripts folder.

Code:
local config = {
   cost = {9970, 10},
   newItem = {11298, 1}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if not doPlayerRemoveItem(cid, config.cost[1], config.cost[2]) then
       doCreatureSay(cid, "You need "..config.cost[2].." " .. getItemInfo(config.cost[1]).plural .. " to buy "..config.newItem[2].."x "..getItemNameById(config.newItem[1])..".", TALKTYPE_ORANGE_1)
       doSendMagicEffect(getThingPos(cid), 2)
       return true
   end
   doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
   doPlayerAddItem(cid, config.newItem[1], config.newItem[2])
   doCreatureSay(cid, "You bought "..config.newItem[2].."x "..getItemNameById(config.newItem[1]).." for "..config.cost[2].." " .. getItemInfo(config.cost[1]).plural .. ".", TALKTYPE_ORANGE_1)
   return true
end

Change the item/cash ids to urs.

In actions.xml add the following line.

Code:
<action uniqueid="65001" script="leverscript.lua"/>

In RME, go find the lever, change its unique id to 65001 or whatever unique id u put in and tada.
 
Back
Top