Bem, é o seguinte:
Tenho um OT Server (Tibia 8.4/Servfull 2.3 Global/The Forgotten Server/SQL)
No meu OT tem uma igreja.
Na minha igreja tem um porquinho (daqueles rosa de por moeda) c/ UID
E fiz uma action pra ele assim:
function onUse(cid, item, frompos, item2, topos) --PIGGY BANK DIZIMO BY SYPHOS-- if item.uid == 6007 then semdinheiro = doPlayerRemoveMoney(cid,10000) if semdinheiro == 1 then doPlayerSendTextMessage(cid,22,"Obrigado! Deus te abençôe!") else end if semdinheiro == 0 then doPlayerSendTextMessage(cid,21,"Sem dinheiro!? Sinta a ira de Deus!") else end else end return 0 end
Esse código funciona como eu queria. Mas achei que tava faltando alguma coisa mais legal. Então decidi dar HP pro player q pagar e tirar HP do player que não tiver dinheiro. E então o código ficou assim:
function onUse(cid, item, frompos, item2, topos) --PIGGY BANK DIZIMO BY SYPHOS-- if item.uid == 6007 then semdinheiro = doPlayerRemoveMoney(cid,10000) hp = getPlayerHealth(cid) if semdinheiro == 1 then doPlayerSendTextMessage(cid,22,"Obrigado! Deus te abençôe!") doPlayerAddHealth(cid,hp*2) else end if semdinheiro == 0 then doPlayerSendTextMessage(cid,21,"Sem dinheiro!? Sinta a ira de Deus!") doPlayerAddHealth(cid,-hp) doPlayerAddHealth(cid,1) else end end return 0 end
Esse não funciona nem rezando. O que será que falta? Alguém pode me ajudar?
Agradeço muito a atenção :smile_positivo: