Ir para conteúdo

Featured Replies

Postado

estou com esse Script aqui ele funciona normal.. Mas quando o char morre ele buga, nao sobe mais em cima da bike e aparece essa msg  "This bike is in use.". Poderia Me Ajudar ?

 


local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999}
local bikeid = 17110 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end

    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            setPlayerStorageValue(cid, 12120, 1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 2139}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 2140}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 2139 or getCreatureOutfit(cid).lookType == 2140 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)
            setPlayerStorageValue(cid, 12120, -1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            doPlayerSendCancel(cid, "This bike isn't yours.")
        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.7k

Informação Importante

Confirmação de Termo