I need help with a script, vitamins, v 8.54 , be possible to help me add a usage limit, for example you can only use 5 of each in a pokemon
Script
function onUse(cid, item, frompos, item2, topos)
tabela_status = {
[6512] = {name="offense", value = 30},
[8982] = {name="defense", value = 30},
[9019] = {name="agility", value = 30},
[9693] = {name="vitality", value = 30},
[2322] = {name="specialattack", value = 30},
}
if #getCreatureSummons(cid) > 0 then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local pb = getPlayerSlotItem(cid, 8)
local pokename = getItemAttribute(pb.uid, "poke")
doRemoveItem(item.uid, 1)
local status = tabela_status[item.itemid]
local pbstat= getItemAttribute(pb.uid, status.name)
local st = pbstat + tabela_status[item.itemid].value
doItemSetAttribute(pb.uid, status.name , st)
doPlayerSendTextMessage((cid), 27, "Your "..pokename.." has eaned "..status.value.." "..status.name.." points!")
doSendFlareEffect(getThingPos(cid))
return true
end
sorry for my bad English