Postado Outubro 13, 2019 5 anos Meu problema é que quando uso a talkaction "!bless", ele acaba comprando todas as 8 blesses, porém geralmente n é perdida todas, então faz stack delas. Queria que alguém conseguisse adaptar o script para comprar apenas as blesses que estão faltando. Citar function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.5 if player:getBlessings() == 5 then player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoneyNpc(totalBlessPrice) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 8 do player:addBlessing(b, 1) end player:setStorageValue(999563, 1) player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) else player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end end Editado Outubro 13, 2019 5 anos por Enforc (veja o histórico de edições)
Postado Outubro 14, 2019 5 anos Solução function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.5 if player:getBlessings() == 5 then player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoneyNpc(totalBlessPrice) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 8 do if not player:hasBlessing(b) then player:addBlessing(b, 1) end end player:setStorageValue(999563, 1) player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) else player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end return false end STYLLER OT 2022
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.