Postado Janeiro 23, 2018 7 anos Gostaria de adaptar minha bike system nessa outra (só precisa organizar os storages, o speed e looktype system da minha para a nova, fazendo assim a script rodar certinha) MINHA SYSTEM: function onUse(cid, item, fromPosition, itemEx, toPosition) local sBike = 2547 local premium = true local speed = 20 -- speed que você quer extra local t = { [18473] = {s=9999, condition=bikeCondition}, } function BikeSpeedOn(cid,nSpeed) setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid)) doChangeSpeed(cid,getCreatureSpeed(cid)+nSpeed) end function BikeSpeedOff(cid) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,getPlayerStorageValue(cid,sBike)) end local v, r = getCreaturePosition(cid), t[item.itemid] local s = r.s local pos = {x = v.x, y = v.y, z = v.z} if r then if getPlayerStorageValue(cid, 25000) == 5 then return end if getPlayerStorageValue(cid, 23000) == 5 then return end if isRiderOrFlyOrSurf(cid) then doPlayerSendCancel(cid, "Dismount your pokemon to mount.") return true end if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid ~= item.uid then return doPlayerSendCancel(cid, "put the bike in the secondary slot.") end if isPlayer(cid) and not isPremium(cid) and premium == true then doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Only premium accounts can mount.") return true end if getPlayerStorageValue(cid, s) <= 0 then doCreatureSay(cid, r.text, 19) setPlayerStorageValue(cid, s, 1) BikeSpeedOn(cid,speed) player_outfit = getCreatureOutfit(cid) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2293, lookHead = player_outfit.lookHead, lookAddons = 0, lookLegs = player_outfit.lookLegs, lookBody = player_outfit.lookBody, lookFeet = player_outfit.lookFeet}, -1) ---Female else doSetCreatureOutfit(cid, {lookType = 2292, lookHead = player_outfit.lookHead, lookAddons = 0, lookLegs = player_outfit.lookLegs, lookBody = player_outfit.lookBody, lookFeet = player_outfit.lookFeet}, -1) --- Male end elseif getPlayerStorageValue(cid, s) == 1 then doCreatureSay(cid, r.dtext, 19) setPlayerStorageValue(cid, s, 0) BikeSpeedOff(cid) return doRemoveCondition(cid, CONDITION_OUTFIT) else return doPlayerSendCancel(cid, 'You can\'t do this.') end else return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.') end end SYSTEM NOVA: -- [Bike System By Nogard, access tibiaking.com for support.] -- function onUse(cid, item, frompos, item2, topos) local config = { [1] = {lookType = 1111}, --- lookType da outfit male. [0] = {lookType = 0000}, --- lookType da outfit female. [msgmount] = 'Você acaba de montar em sua bike.', --- Mensagem que aparecerá ao subir. [msgdesmount] = 'Você desceu da bike.', --- ~~ ~~ ~~ ~~ ~~ ao descer. [speed] = 474 --- Velocidade que terá após subir. } if getPlayerStorageValue(cid, 32001) == 1 then setPlayerStorageValue(cid, 32001, 0) doRemoveCondition(cid, CONDITION_OUTFIT) doSendAnimatedText(getCreaturePosition(cid), 'Bike OFF!', 32) doChangeSpeed(cid, getCreatureSpeed(cid)-config[speed]) doPlayerSendTextMessage(cid, MESSSAGE_STATUS_CONSOLE_ORANGE, config[msgdesmount]) else doChangeSpeed(cid, getCreatureSpeed(cid)+config[speed]) doSetCreatureOutfit(cid, config[getPlayerSex(cid)], -1) doSendAnimatedText(getCreaturePosition(cid), 'Bike ON!', 32) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config[msgmount]) setPlayerStorageValue(cid, 32001, 1) end return true end TENTAR: MANTER AS STORAGES ORGANIZADAS, A DE MONTADO E DESMONTADO, tipo o pedaço de script abaixo, para eu colocar alguns sistemas novos a partir... if getPlayerStorageValue(cid, 32001) == 1 then setPlayerStorageValue(cid, 32001, 0) Editado Janeiro 23, 2018 7 anos por tavarb (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.