Postado Janeiro 2, 2015 10 anos Pessoal estou com bug que está me tirando do sério uheuhe seguinte a bless no servidor é usado como book que da bless! então toda vez que cliko no book ele fala.. você tem todas as bless... sendo que o book não deu use e nem ganhou a bless! Talkactions/script/bless.lua function onUse(cid, item, fromPosition, itemEx, toPosition) local player, bless, blesses, cost = Player(cid), {1, 2, 3, 4, 5}, 0, 0 for _, bless in ipairs(bless) do if player:hasBlessing(bless) then blesses = blesses + 1 end end if blesses ~= #bless then player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem todas as bless.") return false end if player:removeMoney(cost) then for _, bless in ipairs(bless) do player:addBlessing(bless) end player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now blessed!") doSendMagicEffect(player:position(cid), 49) player:removeItem(item.uid) else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce precisa de "..cost.."gps para a bless.") end return true end Talkaction.xml <talkaction words="!bless" script="bless.lua"/> TFS 0.4 DEV Página no facebook: https://www.facebook.com/Suporterking Skype: fabinhodias01 愛"A almapermanece em suas criações" 平 (Dou suporte apenas em tópicos..)
Postado Janeiro 3, 2015 10 anos Se tua TFS for 1.0 tenta usar esse que funcionará: <talkaction words="!bless" separator=" " script="bless.lua" /> e no script coloca: function getCost(level) if level <= 30 then return 2000*5 elseif level >= 120 then return 20000*5 else return ((level - 20) * 200 * 5) end end function onSay(cid, words, param) local p = Player(cid) local cost = getCost(getPlayerLevel(cid)) if(not(isPlayerPzLocked(cid))) then if(p:hasBlessing(1) and p:hasBlessing(2) and p:hasBlessing(3) and p:hasBlessing(4) and p:hasBlessing(5) and p:hasBlessing(6)) then p:sendCancelMessage("You have already been blessed by the gods.") return false end if(p:removeMoney(cost)) then for b = 1,6 do p:addBlessing(b) end p:getPosition():sendMagicEffect(39) p:sendTextMessage(19, "You have been blessed by the gods!") else p:sendCancelMessage("You need "..cost.." gold coins to buy all blessings.") end else p:sendCancelMessage("You can't buy bless, when you are in a battle.") end return false end P.S Lembrando que não é por book esse sistema que você citou (sistema talkaction é do player falar, para o sistema de book deves fazer diferente, usando actions), e sim o player deve dizer !bless Se foi útil, REP+ Abraço. Editado Janeiro 3, 2015 10 anos por rafaelpk20 (veja o histórico de edições) GOSTOU? AJUDEI DE ALGUMA FORMA? REP+ , clica em Gostei.
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.