XZero 68 Postado Março 5, 2017 Share Postado Março 5, 2017 TFS 0.3.6 Estou aprendendo script aos poucos porem nao consigo fazer com que a bike coloque uma Vida adicional ao player quando usa ,e quando desmonta dela volta a vida original , o que eu ja fiz: -o Player Fica coma Vida 10000 < Quero que adicione nao coloque como vida maxima -O Player Fica com a vida 10000 mesmo desmontando da bike < quero que remova a vida adicional e volte a original Spoiler local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed, t.vida) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) setCreatureMaxHealth(cid, t.vida) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) end local function BikeSpeedOff(cid, t) setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) end local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 700, vida = 10000} function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getThingPos(cid) if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Return your pokemon.") 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 --alterado v1.9 return doPlayerSendCancel(cid, "You can't do that right now.") end if getPlayerStorageValue(cid, t.s) <= 0 then doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2128, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) else doSetCreatureOutfit(cid, {lookType = 2127, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) end else doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT) end return true end Link para o comentário Compartilhar em outros sites More sharing options...
Crypter 136 Postado Março 5, 2017 Share Postado Março 5, 2017 1 hora atrás, XZero disse: TFS 0.3.6 Estou aprendendo script aos poucos porem nao consigo fazer com que a bike coloque uma Vida adicional ao player quando usa ,e quando desmonta dela volta a vida original , o que eu ja fiz: -o Player Fica coma Vida 10000 < Quero que adicione nao coloque como vida maxima -O Player Fica com a vida 10000 mesmo desmontando da bike < quero que remova a vida adicional e volte a original Mostrar conteúdo oculto local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed, t.vida) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) setCreatureMaxHealth(cid, t.vida) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) end local function BikeSpeedOff(cid, t) setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) end local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 700, vida = 10000} function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getThingPos(cid) if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Return your pokemon.") 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 --alterado v1.9 return doPlayerSendCancel(cid, "You can't do that right now.") end if getPlayerStorageValue(cid, t.s) <= 0 then doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2128, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) else doSetCreatureOutfit(cid, {lookType = 2127, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) end else doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT) end return true end Não acho uma boa pois se o player relogar vai continuar com a vida assim bugando o servidor, tera de criar essa script + uma função no login.lua.... local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed, t.vida) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) setCreatureMaxHealth(cid, t.vida)doCreatureAddHealth(cid, getCreatureMaxHealth(cid))end local function BikeSpeedOff(cid, t)setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) setCreatureMaxHealth(cid, -t.vida)end local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 700, vida = 10000}function onUse(cid, item, fromPosition, itemEx, toPosition)local pos = getThingPos(cid) if #getCreatureSummons(cid) >= 1 thenreturn doPlayerSendCancel(cid, "Return your pokemon.")endif getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 orgetPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then --alterado v1.9 return doPlayerSendCancel(cid, "You can't do that right now.")endif getPlayerStorageValue(cid, t.s) <= 0 then doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2128, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) else doSetCreatureOutfit(cid, {lookType = 2127, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) endelse doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT)endreturn trueend login.lua if getPlayerStorageValue(cid,5700) >= 1 then setCreatureMaxHealth(cid, -t.vida) end Link para o comentário Compartilhar em outros sites More sharing options...
Stigal 584 Postado Novembro 29, 2017 Share Postado Novembro 29, 2017 A questão neste tópico de suporte foi encerrada por falta de resposta. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados