EstebanGod
New Member
- Joined
- Jun 18, 2014
- Messages
- 83
- Reaction score
- 3
Ok, Im using a script I found around the web to sell runes and potions using a lever.
It works, But not completly, it gives the character the runes or potions but it wont take the money from them. Help would be really aprreciated. Heres my script.
It works, But not completly, it gives the character the runes or potions but it wont take the money from them. Help would be really aprreciated. Heres my script.
Code:
local config = {cantidad = 100}
local aid = { --actionid, itemid, cost}
[5600] = {2260, 1000},
[5601] = {2268, 9500},
[5602] = {7618, 4500},
[5603] = {7588, 10000},
[5604] = {7591, 19000},
[5605] = {8473, 31000},
[5606] = {2273, 7500},
[5607] = {2274, 9000},
[5608] = {2271, 6500},
[5609] = {8472, 19000},
[5610] = {2278, 20000},
[5611] = {2293, 35000},
[5612] = {2313, 25000},
[5613] = {7620, 5000},
[5614] = {7589, 8000},
[5615] = {7590, 12000},}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local aids = aid[item.actionid]
if item.itemid == 1945 then
if aids then
if doPlayerAddItem(cid, aids[1], config.cantidad, false) == RETURNVALUE_NOERROR then
if doPlayerRemoveMoney(cid, aids[3]) then
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'You've got x'..cantidad.config..' '..getItemNameById(aids[1])..'.')
else
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'You need '..aids[2]..' gold to buy this.')
end
else
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'No Cap.')
end
end
return true
end
end
Last edited by a moderator: