function onUse(cid, item, frompos, item2, topos)
local config = {
[9991] = {name="level", value=100, cost=0, id=8},
[9992] = {name="magic level", value=100, cost=0, id=7},
[9993] = {name="axe", value=100, cost=0, id=3},
[9994] = {name="club", value=100, cost=0, id=1},
[9995] = {name="sword", value=100, cost=0, id=2},
[9996] = {name="fist", value=100, cost=0, id=0},
[9997] = {name="shielding", value=100, cost=0, id=5},
[9998] = {name="fishing", value=100, cost=0, id=6},
[9999] = {name="distance", value=100, cost=0, id=4}
}
if getPlayerMoney(cid) >= config[item.uid].cost then
doPlayerAddSkillTry(cid, config[item.uid].id, config[item.uid].value)
doPlayerSendTextMessage(cid, 25, "You gained " .. config[item.uid].value .. " of " .. config[item.uid].name .. " for " .. config[item.uid].cost .. " gold coins.")
doSendMagicEffect(frompos, math.random(1, 10))
doPlayerRemoveMoney(cid, config[item.uid].cost)
else
doPlayerSendTextMessage(cid, 20, "You need " .. config[item.uid].cost .. " gold coins to gain " .. config[item.uid].value .. " of " .. config[item.uid].name .. ".")
doSendMagicEffect(frompos, 2)
return true
end
return true
end