hp_id = 7618 -- Item a ser vendido
custohp_id = 900 -- Valor
cargashp_id = 100 -- Cargas
local name = getItemNameById(hp_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, custohp_id) == TRUE then
doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased ".. name .."s for ".. custohp_id .." gold.")
doPlayerAddItem(cid, hp_id, cargashp_id)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins to buy ".. name .."s.")
end
return FALSE
end
Acho que funciona




info
Grupo: Artesão
Registrado: 09/08/07
Posts: 138
Reputação: +1
Char no Tibia: Gabii'zinhaa
Galera, no meu servidor eu uso o sistema de potions e runas por alavanca...
Porém tenho uma duvida.
Tipo...
No meu servidor quando você puxa a alavanca, vem uma backpack e dentro vem 100 health potions agrupadas
Como eu boto apenas pra vir só as 100 health potions agrupadas sem a backpack?
Script abaixo:
healthpotion.lua
hp_id = 7618 -- Item a ser vendido backpackhp_id = 2000 -- Backpack custohp_id = 900 -- Valor cargashp_id = 20 -- Cargas local name = getItemNameById(hp_id) ----- End Config ----- function onUse(cid, item, fromPosition, itemEx, toPosition) if doPlayerRemoveMoney(cid, custohp_id) == TRUE then local bag = doPlayerAddItem(cid, backpackhp_id, 1) doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custohp_id .." gold.") for i=1,20 do doAddContainerItem(bag, hp_id, cargashp_id) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins for a backpack of ".. name .."s.") end return FALSE endThanks, REP + pra quem ajudar ;D
vlw.