Postado Fevereiro 22, 2018 7 anos Autor Thanks a lot! it made me realize how I could modify it to my taste! But unlucly it didnt worked as i tought In example now it goes like this With my now edited code (From Sergio R :D!) I do. !bless and it goes If not in fight then i get bless if with not enough money it goes blockhit if aready bought it it goes poff if in battle it goes drawblood (everything is fine there) ! But is there any possibility to make it so when I already bought the blessings with !bless then it no longer tries to get the other variables like drawblood if in fight ?( If player has blessings then no longer tries to ask for money, get fight condition etc.) Here is the code im using right now. function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7 if(not(getCreatureCondition(cid, CONDITION_INFIGHT))) then if player:getBlessings() == 5 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoney(totalBlessPrice) then player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 5 do player:addBlessing(b, 1) end else player:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end else player:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD) player:sendCancelMessage("You can't buy bless while you have battle time left.") end end Thanks in advance man !
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.