Postado Maio 5, 2015 10 anos Você provavelmente está usando um item que não foi configurado na tabela mounts. PS: O que já foi configurado como exemplo é um ID hipotético. Editado Maio 5, 2015 10 anos por zipter98 (veja o histórico de edições)
Postado Maio 5, 2015 10 anos Autor pergunta, tem como colocar chance de acerto, e quebra o item tal ?
Postado Maio 5, 2015 10 anos Solução local mounts = { --[itemid] = {name = "monster", storage = storage, mountId = xxx, chance = xxx}, [13937] = {name = "donkey", storage = 5918, mountId = 13, chance = 50}, --Sendo a chance (de funcionar) em porcentagem. } function onUse(cid, item, frompos, itemEx, topos) local target = mounts[item.itemid] if target then if getPlayerStorageValue(cid, target.storage) > -1 then return doPlayerSendTextMessage(cid, 19, "Sorry, you already have that ride.") elseif not isMonster(itemEx.uid) then return doPlayerSendCancel(cid, "Use this in a monster.") elseif getCreatureName(itemEx.uid):lower() ~= target.name then return doPlayerSendCancel(cid, "Use this in "..target.name..".") end if math.random(1, 100) <= target.chance then doPlayerAddMount(cid, target.mountId) doRemoveCreature(itemEx.uid) doPlayerSendTextMessage(cid, 19, "The strange wheel seems to vibrate and slowly starts turning continuosly.") setPlayerStorageValue(cid, target.mountId, 1) else doPlayerSendCancel(cid, "Fail!") doRemoveItem(item.uid, 1) end end return true end
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.