Ir para conteúdo

Featured Replies

  • Respostas 15
  • Visualizações 442
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local monster, storage = "donkey", 5918 function onUse(cid, item, frompos, itemEx, topos)     if getPlayerStorageValue(cid, storage) > -1 then         return doPlayerSendTextMessage(cid, 19, "Sorry

  • local mounts = {     --[itemid] = {name = "monster", storage = storage, mountId = xxx, chance = xxx},      [13937] = {name = "donkey", storage = 5918, mountId = 13, chance = 50},        --Sendo a chan

  • local mounts = {     --[itemid] = {name = "monster", storage = storage, mountId = xxx},      [13937] = {name = "donkey", storage = 5918, mountId = 13}, } function onUse(cid, item, frompos, itemEx, top

Postado
  • 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo