Postado Maio 28, 2015 9 anos Autor use meu script local config = { velocidadeDaSuaBike = 1000, -- A volocidade da bike (1-9) outfitMale = 1787, -- Outfit male outfitFemale = 1618, -- Outfit female storageValue = 5602, -- Storage Para a bike } function onUse(cid, item, itemEx, fromPosition, toPosition) if getPlayerStorageValue(cid, 17001) > 0 then doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto estiver no ride/fly/surf.") return false end if getPlayerStorageValue(cid, 17000) > 0 then doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto estiver no ride/fly/surf.") return false end if getPlayerStorageValue(cid, 63215) > 0 then doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto estiver no ride/fly/surf.") return false end if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end if getPlayerStorageValue(cid, config.storageValue) <= 0 then local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet} local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet} setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."") doSendMagicEffect(getThingPos(cid), 18) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, config.velocidadeDaSuaBike) setPlayerStorageValue(cid, config.storageValue, 1) if getPlayerSex(cid) == 0 then doSetCreatureOutfit(cid, b, -1) else doSetCreatureOutfit(cid, a, -1) end else setPlayerStorageValue(cid, config.storageValue, 0) doSendMagicEffect(getThingPos(cid), 18) doRemoveCondition(cid, CONDITION_OUTFIT) doRegainSpeed(cid) end return true end e adicione essa função no login.lua if getCreatureSpeed(cid) ~= getCreatureBaseSpeed(cid) then local delta = ( (getCreatureBaseSpeed(cid)) - (getCreatureSpeed(cid)) ) doChangeSpeed(cid, delta) end para configurar o script da bike é nessa parte velocidadeDaSuaBike = 1000, -- A volocidade da bike (1-9) outfitMale = 1787, -- Outfit male outfitFemale = 1618, -- Outfit female storageValue = 5602, -- Storage Para a bike Man vc n entendeu eu já tenho o script dá bike completo só queria que ao clicar use no item da bike ele se tranformace em outro e ao dar use novamente restornasse a sua forma normal tem como?
Postado Maio 28, 2015 9 anos Man vc n entendeu eu já tenho o script dá bike completo só queria que ao clicar use no item da bike ele se tranformace em outro e ao dar use novamente restornasse a sua forma normal tem como? Creio que sim, deixa eu ver como funciona o sistema de pokeball do pda para fazer igual
Postado Maio 28, 2015 9 anos Autor Creio que sim, deixa eu ver como funciona o sistema de pokeball do pda para fazer igual Blza
Postado Julho 8, 2015 9 anos O script da bike ficará assim: local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999} local bikeid = 1212 -- 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 = 1951}, -1) else doSetCreatureOutfit(cid, {lookType = 1950}, -1) end else doPlayerSendCancel(cid, "This bike is in use.") end else if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1951 or getCreatureOutfit(cid).lookType == 1950 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 Agora em creaturescripts.xml adicione a tag: <event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/> E em SystemLogout.lua, adicione o script abaixo: function onLogout(cid) if getPlayerStorageValue(cid, 12120) > 0 then return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false end return true end Agora em login.lua, adicione a tag abaixo junto com as do gênero: registerCreatureEvent(cid, "EventLogout") Boa sorte. Cara como posso deixar 3 vezes mais rapido a velocidade do player com a bike?(estou querendo usar alguma variavel no speed = 9999) _____________________________________________________________________________________________________________________ E onde eu coloco essa tag: registerCreatureEvent(cid, "EventLogout") Tipo, não sei con esta o tal gênero
Postado Julho 20, 2015 9 anos Ae eu tenho script de bike tbm funcionou legal. só que eu queria saber se tem como fazer o seguinte. quando o player for morrer ele desmontase automaticamente da bike. pq ta dando um bug :| Editado Julho 21, 2015 9 anos por ztalkerr (veja o histórico de edições)
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.