Antes De Tudo Quero Dizer Que Esse é O Primeiro Script Feito Por Mim Mesmo.
Mais Vamu Lá !
Vá Na Pasta \data\talkactions\scripts De Seu Ot Serv E Crie Um Arquivo COm Nome De: buyhp
Dentro COle Isso:
function onSay(cid, words, param) local itemid = 2160 local health = 10000 if doPlayerRemoveItem(cid,2160,100) then setCreatureMaxHealth(cid, getCreatureHealth(cid) + health) else doPlayerSendCancel(cid, "Vc N Tem Money Suficiente") end return TRUE end
Depois Vá Em \data\talkactions E Abra o talkactions.xml
E Adcione Isso:
<talkaction words="!buyhp" event="script" value="buyhp.lua"/>
Agora o De Comprar Mana !
Vá Na Pasta \data\talkactions\scripts De Seu Ot Serv E Crie Um Arquivo COm Nome De: buymana
Dentro COle Isso:
function onSay(cid, words, param) local itemid = 2160 local mana = 10000 if doPlayerRemoveItem(cid,2160,100) then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + mana) else doPlayerSendCancel(cid, "Vc Não Tem Money Suficiente") end return TRUE end
Depois Vá Em \data\talkactions E Abra o talkactions.xml
E Adcione Isso:
<talkaction words="!buymp" event="script" value="buymana.lua"/>
Obs:
local itemid = 2160 <- Id Do Iten Que Será Retirado Do Player.
if doPlayerRemoveItem(cid,2160,100) then <- Id Do Iten Que Será Retirado Do Player, E Tanto que Será Retirado.
*Vermelho: Id Do Iten a Ser Removido DO Player.
*Azul: o Tanto De Iten A Ser Removido Do Player.
local health = 10000 <- O Tanto De Vida Que O Player Recebera Após Usar O Comando.
local mana = 10000 <- O Tanto De Mana Que O Player Recebera Após Usar O Comando.
Comandos ...
!buyhp
!buymp