gabizinhaah 1 Postado Março 9, 2011 Share Postado Março 9, 2011 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 end Thanks, REP + pra quem ajudar ;D vlw. Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/ Compartilhar em outros sites More sharing options...
Daimonium 5 Postado Março 9, 2011 Share Postado Março 9, 2011 (editado) 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 Editado Março 9, 2011 por Daimonium Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/#findComment-1010633 Compartilhar em outros sites More sharing options...
gabizinhaah 1 Postado Março 9, 2011 Autor Share Postado Março 9, 2011 Não deu certo... ele não entregou nada... :x Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/#findComment-1010634 Compartilhar em outros sites More sharing options...
Daimonium 5 Postado Março 10, 2011 Share Postado Março 10, 2011 (editado) Não deu certo... ele não entregou nada... :x Voce deve ter criado outro arquivo lua, por isso nao funcionou, mais esta ae o script para um novo arquivo lua: function onUse(cid, item, fromPosition, itemEx, toPosition) hp_id = 7618 -- Item a ser vendido custohp_id = 900 -- Valor cargashp_id = 100 -- Cargas local name = getItemNameById(hp_id) 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) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins to buy ".. name .."s.") end return true end PS: Para funcionar o outro la em cima, voce precisa trocar pelo script que voce passou. Editado Março 10, 2011 por Daimonium Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/#findComment-1010885 Compartilhar em outros sites More sharing options...
gabizinhaah 1 Postado Março 10, 2011 Autor Share Postado Março 10, 2011 (editado) Vou testar, se funcionar eu edito. (: deu certo thanks, REP + Só tive um probleminha... O script da strong mana potion não funcionou... o das outras funcionou... script da Strong mana potion: function onUse(cid, item, fromPosition, itemEx, toPosition) hp_id = 7589 -- Item a ser vendido custohp_id = 6500 -- Valor cargashp_id = 100 -- Cargas local name = getItemNameById(hp_id) 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) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins to buy ".. name .."s.") end return true end Editado Março 10, 2011 por gabih Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/#findComment-1010972 Compartilhar em outros sites More sharing options...
thebeck 0 Postado Julho 17, 2011 Share Postado Julho 17, 2011 faz assim gabi. voce usou o script da health potion no lugar da mana potion altera isso function onUse(cid, item, fromPosition, itemEx, toPosition) mp_id = 7620 -- Item a ser vendido customp_id = 6500 -- Valor cargasmp_id = 100 -- Cargas local name = getItemNameById(mp_id) if doPlayerRemoveMoney(cid, customp_id) == TRUE then doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased ".. name .."s for ".. customp_id .." gold.") doPlayerAddItem(cid, mp_id, cargasmp_id) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. customp_id .." gold coins to buy ".. name .."s.") end return true end alterando os hp_id por mp_id, e o id por 7620 testae Link para o comentário https://xtibia.com/forum/topic/153043-duvida-sobre-pots-por-alavanca/#findComment-1066882 Compartilhar em outros sites More sharing options...
Posts Recomendados