Postado Setembro 23, 2018 6 anos TFS 0.3.6 Eae galera! Será que alguém poderia me ajudar em uma coisa aqui? Tenho um sistema de bike funcionando perfeitamente, por slots, etc. Só que quero que ao andar montado na bike, fique um efeito 1SQM atrás do player. Imagem de exemplo: Spoiler Meu script: Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local sBike = 7857 or 7858 local t = { [7857] = {article='a', name='bike', s=5700, condition=bikeCondition}, [7858] = {article='a', name='bike', s=5700, condition=bikeCondition}, } function BikeSpeedOn(cid,nSpeed) doTransformItem(itemEx.uid, 7858) setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid)) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,nSpeed) end function BikeSpeedOff(cid) doTransformItem(itemEx.uid, 7857) 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, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then return doPlayerSendCancel(cid, "Voce nao pode montar na (BIKE) se estiver no ride/fly/surf.") end if getPlayerSlotItem(cid, CONST_SLOT_RING).uid ~= item.uid then return doPlayerSendCancel(cid, "Voce precisa por a (BIKE) no lugar correto.") end if getPlayerStorageValue(cid, s) <= 0 then setPlayerStorageValue(cid, s, 1) BikeSpeedOn(cid,1000) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 897, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) else doSetCreatureOutfit(cid, {lookType = 897, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) end elseif getPlayerStorageValue(cid, s) == 1 then 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 Quem puder ajudar agradeço. Obrigado!
Postado Setembro 27, 2018 6 anos Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Spoiler Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!Please read the forum rules.
Postado Setembro 27, 2018 6 anos function onLogin(cid) registerCreatureEvent(cid, "EffectOutLogin") registerCreatureEvent(cid, "OutfitEffects") return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end local events = {} function onOutfit(cid, old, current) local effect = {[897] = 6} -- looktype and effect local o, c= effect[old.lookType],effect[current.lookType] if getPlayerAccess(cid) > 2 then return true elseif (not o or not c) then stopEvent(events[getPlayerGUID(cid)]) end if c then function WalkEffect(cid, c, pos) if not isCreature(cid) then return LUA_ERROR end if c then frompos = getThingPos(cid) if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos) end return true end WalkEffect(cid, c, {x=0, y=0, z=0}) end return true end TAG <event type="login" name="EffectOutLogin" event="script" value="nome do seu script.lua"/> <event type="outfit" name="OutfitEffects" event="script" value="nome do seu script.lua"/> [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Setembro 28, 2018 6 anos Em 27/09/2018 em 17:08, Vodkart disse: function onLogin(cid) registerCreatureEvent(cid, "EffectOutLogin") registerCreatureEvent(cid, "OutfitEffects") return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end local events = {} function onOutfit(cid, old, current) local effect = {[897] = 6} -- looktype and effect local o, c= effect[old.lookType],effect[current.lookType] if getPlayerAccess(cid) > 2 then return true elseif (not o or not c) then stopEvent(events[getPlayerGUID(cid)]) end if c then function WalkEffect(cid, c, pos) if not isCreature(cid) then return LUA_ERROR end if c then frompos = getThingPos(cid) if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos) end return true end WalkEffect(cid, c, {x=0, y=0, z=0}) end return true end TAG <event type="login" name="EffectOutLogin" event="script" value="nome do seu script.lua"/> <event type="outfit" name="OutfitEffects" event="script" value="nome do seu script.lua"/> Aonde adiciona isso
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.