Ir para conteúdo

Ayron5

Barão
  • Total de itens

    239
  • Registro em

  • Última visita

  • Dias Ganhos

    7

Posts postados por Ayron5

  1. Como essa área está parada a muito tempo, resolvi compartilhar um layout que editei de acordo com meu gosto.

    Deixei simplão mesmo, tá usável e fácil de editar.

    O que vale é ajudar. XD

    Créditos para otpk... e o Benny pois usei o dele como base.

     

    Imagem:

    Spoiler

    Untitled-2.png.1ba7a20e74de1a38ee290d2408f0cb9a.png

    Link: 

     

    Scan:

    Spoiler

    Untitled-2.png

     

  2. 12 minutos atrás, gristony disse:

    imgbin-pok-mon-logo-scizor-drifloon-pokemon-P8L4UgE8L61ffzkhqHguPkccC.png.23145f344d8a51515380c87f5e6bcd35.png

    BrPokeOT Lançamento hoje 15/06/2020, 24/07 horas online

    site: http://brpokeot.com/

    Facebook: https://www.facebook.com/brpokeot
    Discord:
    https://discord.gg/ramCnDc

     

    Changelog

      Ocultar conteúdo
    • Sistema Anti Rollback(se por algum motivo server vir a cair, será salvo na mesma hora assim evitando rollbacks e clones.)
    • Backup diario da Database(Com intuito de evitar grandes perdas em algum acidente)
    • Sem bug de sumir item/pokemon nas bags
    • Autoloot System 100%
    • Reward Level System
    • Shiny stone NÃO transforma pokemons normais em shiny
    • servidor medio exp e catch.
    • servidor 24/7 horas online.
    • Servidor balanceado de acordo com BULBAPEDIA "DADOS OFICIAIS DA POKEMON COMPANY"
    • Pokemons shiny tem só 50% a mais de bonus status bases.
    • Fly, Surf, ride e teleport Free
    • Todos os helds
    • torneio pvp{suvival} todos os dias.
    • daily task caught diario
    • Darkray Dugeon/Evento pesadelo
    • Nature System
    • Boost Machine individual(Anti-Furto)
    • Mapa todo feito do 0. Veja aqui
    • Mais de 100 spells novas feitas.
    • Pokemons da 1ª, 2ª geração.
    • Mais de 40 Quests.
    • Auto loot com interface ( janela, aonde você pode configurar seu autoloot ).
    • Eventos automaticos.
    • Held Machine, que troca Tokens por Held.
    • Clan sistem.
    • Outlands.
    • Main Quest.
    • 80 novos items de loot.
    • Loots balanceados.
    • Shiny ditto com Ditto Memory.
    • Sistema de Pesca.
    • Addon system, alguns addons podem mudar de cores como desejar.
    • Catch balanceado.
    • Sistema de Market.
    • Pokebar.
    • Icon system.
    • Duel system.
    • Remake em varias sprites de mapa, pokemons e itens.



     

    Faz alguns anos q vc trabalha nela não é? acho que lembro do inicio ^^

    Boa sorte aí mano.

    Vou conferir lá. 

  3. Em 19/05/2020 em 09:51, manojl disse:

    Alguém tem um GYM system para add nas sources ???

    Nos grupos do facebook querem me vender por 600 conto...
    + caro q um revolver...

    Surreal isso...

    To montando um projeto do 0 e queria um gm system...
    Quem quizer mandar por pm tbm aceito... 
    Obrigado pela atenção!

    Absurdo.

     

    48 minutos atrás, nociam disse:

    Se quiser eu refaço tudo sem erros sem adaptar nada, só me passar qual base usa e aonde baixar irei analisar se já tem algo e é só ajuste podemos ajudar sem valores se quiser algo do 0 podemos conversar tb faço tudo em C++. 

    E faz mesmo, hj eu tenho esse sistema graças a ele @nociam gente boa de mais. 

  4. 1 hora atrás, rubenssantana91 disse:

    Boa noite, gostaria de saber como faço para ter um portal que transporte so pessoa com acesso vip ou donate.

    desde ja agradeço ?

    Mano pode ser por tile/piso?

     

    testa aí... vai na pasta movements e cria um arquivo chamado tileVip.lua e coloca isso dentro.

    Spoiler
    
    function onStepIn(cid, item, position, fromPosition)
      
    destino = {x=1051, y=1049, z=7}  -- lugar para onde o player vai, edite ao seu gosto
      
    if isPlayer(cid) then
    if isPremium(cid) == TRUE or getPlayerPremiumDays(cid) >= 1 then 
    doTeleportThing(cid, destino)
    doPlayerSendTextMessage(cid, 25, "Boa sorte!")
    else
    doTeleportThing(cid, fromPosition, true)
    end
    end
    return true
    end

     

    Em movements.xml cole essa tag

    Citar

    <movevent type="StepIn" actionid="200" event="script" value="tileVip.lua"/>

    Agora vá no editor de mapa e coloca um piso que vc queira, feito isso clica com o botão direito do mouse sobre ele e coloca em Action ID 200 igual está na imagem.

    Spoiler

    tile.png.9b621b669bd5eebfc2864bed7eb322a5.png

    Feito isso salva tudo e vai testar... ^^

  5. 45 minutos atrás, BrunooMaciell disse:

    Pego perfeito !!

     

    Valeuu 

     

    Rep++

    Bom o seu testei ele nao funciona porem nao deu erro tbem tipo ele fico normal !!

     

    Mas o amigo aii de cima ja ajudou ^^

     

    Mesmo assim valeuu ? 

    Que bom :D: boa sorte no seu projeto. ^^

  6. 22 horas atrás, BrunooMaciell disse:
    Versão do Servidor: TFS - 0.3.4
    Tipo de Script: actions
    Código:
      Mostrar conteúdo oculto
    
    
    
     

    Estou querendo por no meu sistema de pesca pra pedir a roupa de pesca pra poder pesca.

     

    Porem nao lembro o codigo pra ADD na minha script de pesca.

     

    SCRIPT

    
    local fishing = {
    ["Magikarp"] = {skill = 1, level = 1},
    ["Krabby"] = {skill = 5, level = 5},
    ["Horsea"] = {skill = 5, level = 5},
    ["Luvdisc"] = {skill = 10, level = 10},
    ["Finneon"] = {skill = 10, level = 10},
    ["Tympole"] = {skill = 10, level = 10},
    ["Tirtouga"] = {skill = 10, level = 10},
    ["Ducklett"] = {skill = 10, level = 10},
    ["Clamperl"] = {skill = 15, level = 15},
    ["Tynamo"] = {skill = 15, level = 15},
    ["Spheal"] = {skill = 15, level = 15},
    ["Goldeen"] = {skill = 20, level = 20},
    ["Marill"] = {skill = 20, level = 20},
    ["Remoraid"] = {skill = 20, level = 20},
    ["Tentacool"] = {skill = 20, level = 20},
    ["Corphish"] = {skill = 20, level = 20},
    ["Poliwag"] = {skill = 25, level = 25},
    ["Chinchou"] = {skill = 25, level = 25},
    ["Basculin"] = {skill = 30, level = 30},
    ["Staryu"] = {skill = 30, level = 30},
    ["Mantyke"] = {skill = 30, level = 30},
    ["Seaking"] = {skill = 30, level = 30},
    ["Psyduck"] = {skill = 35, level = 35},
    ["Stunfisk"] = {skill = 35, level = 35},
    ["Lanturn"] = {skill = 45, level = 45},
    ["Lumineon"] = {skill = 45, level = 45},
    ["Seadra"] = {skill = 45, level = 45},
    ["Poliwhirl"] = {skill = 50, level = 50},
    ["Qwilfish"] = {skill = 50, level = 50},
    ["Corsola"] = {skill = 50, level = 50},
    ["Squirtle"] = {skill = 55, level = 55},
    ["Totodile"] = {skill = 55, level = 55},
    ["Mudkip"] = {skill = 55, level = 55},
    ["Piplup"] = {skill = 55, level = 55},
    ["Oshawott"] = {skill = 55, level = 55},
    ["Huntail"] = {skill = 60, level = 60},
    ["Eelektrik"] = {skill = 60, level = 60},
    ["Alomomola"] = {skill = 60, level = 60},
    ["Gorebyss"] = {skill = 60, level = 60},
    ["Palpitoad"] = {skill = 60, level = 60},
    ["Azumarill"] = {skill = 65, level = 65},
    ["Octillery"] = {skill = 65, level = 65},
    ["Kingler"] = {skill = 65, level = 65},
    ["Relicanth"] = {skill = 65, level = 65},
    ["Marshtomp"] = {skill = 70, level = 70},
    ["Crawdaunt"] = {skill = 70, level = 70},
    ["Wartortle"] = {skill = 70, level = 70},
    ["Prinplup"] = {skill = 70, level = 70},
    ["Dewott"] = {skill = 70, level = 70},
    ["Croconaw"] = {skill = 70, level = 70},
    ["Feebas"] = {skill = 80, level = 80},
    ["Starmie"] = {skill = 85, level = 85},
    ["Golduck"] = {skill = 90, level = 90},
    ["Vaporeon"] = {skill = 90, level = 90},
    ["Kingdra"] = {skill = 100, level = 100},
    ["Blastoise"] = {skill = 125, level = 125},
    ["Feraligatr"] = {skill = 125, level = 125},
    ["Empoleon"] = {skill = 125, level = 125},
    ["Swampert"] = {skill = 125, level = 125},
    ["Tentacruel"] = {skill = 130, level = 130},
    ["Eelektross"] = {skill = 130, level = 130},
    ["Gyarados"] = {skill = 130, level = 130},
    ["Samurott"] = {skill = 130, level = 130},
    ["Wailord"] = {skill = 140, level = 140},
    ["Milotic"] = {skill = 150, level = 150},
    }
    
    local storage = 15458
    local bonus = 1
    local limite = 150
    
    
    local function doFish(cid, pos, ppos, chance, interval, number)
          if not isCreature(cid) then return false end
          if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then
             return false 
          end
          if getPlayerStorageValue(cid, storage) ~= number then return false end
          
          doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
    
          local peixe = 0
          local playerpos = getClosestFreeTile(cid, getThingPos(cid))
          local fishes = {}
          local randomfish = ""
          
          if getPlayerSkillLevel(cid, 6) < limite then 
    	     doPlayerAddSkillTry(cid, 6, bonus)
          end
    
          for a, b in pairs (fishing) do
    	      if getPlayerSkillLevel(cid, 6) >= b.skill then
    		     table.insert(fishes, a)
              end
          end
    
    	  if math.random(1, 100) <= chance then
             if getPlayerSkillLevel(cid, 6) < limite then 
    		    doPlayerAddSkillTry(cid, 6, bonus)
             end
    		 randomfish = fishes[math.random(#fishes)]
    	     peixe = doSummonCreature(randomfish, playerpos)
    		 if not isCreature(peixe) then
                addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
    		    return true
    		 end
    	     -- doSetMonsterPassive(peixe)
    	     -- doWildAttackPlayer(peixe, cid)
    	     doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe)))  --alterado ver depois
    		 if #getCreatureSummons(cid) >= 1 then
     		    doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)
    			doChallengeCreature(getCreatureSummons(cid)[1], peixe)
      	     else
                doSendMagicEffect(getThingPos(cid), 173)
    			doChallengeCreature(cid, peixe)
      	     end
    	     return true
          end
          addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
    return true
    end
    
    local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 23765, 23766}
    
    function onUse(cid, item, fromPos, itemEx, toPos)
    
    if getPlayerGroupId(cid) == 11 then
    return true
    end
    
    local checkPos = toPos
    checkPos.stackpos = 0
    
    if getTileThingByPos(checkPos).itemid <= 0 then
       doPlayerSendCancel(cid, '!')
       return true
    end
    
    if not isInArray(waters, getTileInfo(toPos).itemid) then
       return true
    end
    
    if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then
       doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
       return true
    end
    
    if isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then
       doPlayerSendCancel(cid, "You can\'t fish while surfing neither flying above water.")
       return true
    end
    
    if getTileInfo(getThingPos(getCreatureSummons(cid)[1] or cid)).protection then
    	doPlayerSendCancel(cid, "You can't fish pokémons if you or your pokémon is in protection zone.")
    return true
    end
    
    if not tonumber(getPlayerStorageValue(cid, storage)) then
    	local test = io.open("data/sendtobrun123.txt", "a+")
    	local read = ""
    	if test then
    		read = test:read("*all")
    		test:close()
    	end
    	read = read.."\n[fishing.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, storage)..""
    	local reopen = io.open("data/sendtobrun123.txt", "w")
    	reopen:write(read)
    	reopen:close()
    	setPlayerStorageValue(cid, storage, 1)
    end
    
    setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
    if getPlayerStorageValue(cid, storage) >= 800 then
       setPlayerStorageValue(cid, storage, 1)
    end
    
    local delay = 3500 - getPlayerSkillLevel(cid, 6) * 25
    local chance = 10 + getPlayerSkillLevel(cid, 6) / 2.5
    
    doFish(cid, toPos, getThingPos(cid), chance, delay, getPlayerStorageValue(cid, storage))
    
    return true
    end

     

    Quem puder ajudar REP++

    Aqui está! Fiz as Alterações no seu script, testei aqui e está 100% dá forma que vc pediu. ^^

     

    Spoiler
    
    local fishing = {
    ["Magikarp"] = {skill = 1, level = 1},
    ["Krabby"] = {skill = 5, level = 5},
    ["Horsea"] = {skill = 5, level = 5},
    ["Luvdisc"] = {skill = 10, level = 10},
    ["Finneon"] = {skill = 10, level = 10},
    ["Tympole"] = {skill = 10, level = 10},
    ["Tirtouga"] = {skill = 10, level = 10},
    ["Ducklett"] = {skill = 10, level = 10},
    ["Clamperl"] = {skill = 15, level = 15},
    ["Tynamo"] = {skill = 15, level = 15},
    ["Spheal"] = {skill = 15, level = 15},
    ["Goldeen"] = {skill = 20, level = 20},
    ["Marill"] = {skill = 20, level = 20},
    ["Remoraid"] = {skill = 20, level = 20},
    ["Tentacool"] = {skill = 20, level = 20},
    ["Corphish"] = {skill = 20, level = 20},
    ["Poliwag"] = {skill = 25, level = 25},
    ["Chinchou"] = {skill = 25, level = 25},
    ["Basculin"] = {skill = 30, level = 30},
    ["Staryu"] = {skill = 30, level = 30},
    ["Mantyke"] = {skill = 30, level = 30},
    ["Seaking"] = {skill = 30, level = 30},
    ["Psyduck"] = {skill = 35, level = 35},
    ["Stunfisk"] = {skill = 35, level = 35},
    ["Lanturn"] = {skill = 45, level = 45},
    ["Lumineon"] = {skill = 45, level = 45},
    ["Seadra"] = {skill = 45, level = 45},
    ["Poliwhirl"] = {skill = 50, level = 50},
    ["Qwilfish"] = {skill = 50, level = 50},
    ["Corsola"] = {skill = 50, level = 50},
    ["Squirtle"] = {skill = 55, level = 55},
    ["Totodile"] = {skill = 55, level = 55},
    ["Mudkip"] = {skill = 55, level = 55},
    ["Piplup"] = {skill = 55, level = 55},
    ["Oshawott"] = {skill = 55, level = 55},
    ["Huntail"] = {skill = 60, level = 60},
    ["Eelektrik"] = {skill = 60, level = 60},
    ["Alomomola"] = {skill = 60, level = 60},
    ["Gorebyss"] = {skill = 60, level = 60},
    ["Palpitoad"] = {skill = 60, level = 60},
    ["Azumarill"] = {skill = 65, level = 65},
    ["Octillery"] = {skill = 65, level = 65},
    ["Kingler"] = {skill = 65, level = 65},
    ["Relicanth"] = {skill = 65, level = 65},
    ["Marshtomp"] = {skill = 70, level = 70},
    ["Crawdaunt"] = {skill = 70, level = 70},
    ["Wartortle"] = {skill = 70, level = 70},
    ["Prinplup"] = {skill = 70, level = 70},
    ["Dewott"] = {skill = 70, level = 70},
    ["Croconaw"] = {skill = 70, level = 70},
    ["Feebas"] = {skill = 80, level = 80},
    ["Starmie"] = {skill = 85, level = 85},
    ["Golduck"] = {skill = 90, level = 90},
    ["Vaporeon"] = {skill = 90, level = 90},
    ["Kingdra"] = {skill = 100, level = 100},
    ["Blastoise"] = {skill = 125, level = 125},
    ["Feraligatr"] = {skill = 125, level = 125},
    ["Empoleon"] = {skill = 125, level = 125},
    ["Swampert"] = {skill = 125, level = 125},
    ["Tentacruel"] = {skill = 130, level = 130},
    ["Eelektross"] = {skill = 130, level = 130},
    ["Gyarados"] = {skill = 130, level = 130},
    ["Samurott"] = {skill = 130, level = 130},
    ["Wailord"] = {skill = 140, level = 140},
    ["Milotic"] = {skill = 150, level = 150},
    }
    
    local storage = 15458
    local storageP = 154580
    local bonus = 1
    local limite = 150
    
    
    local function doFish(cid, pos, ppos, chance, interval, number)
          if not isCreature(cid) then return false end
          if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then
             return false 
          end
          if getPlayerStorageValue(cid, storage) ~= number then return false end
          
          doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
    
          local peixe = 0
          local playerpos = getClosestFreeTile(cid, getThingPos(cid))
          local fishes = {}
          local randomfish = ""
          
          if getPlayerSkillLevel(cid, 6) < limite then 
    	     doPlayerAddSkillTry(cid, 6, bonus)
          end
    
          for a, b in pairs (fishing) do
    	      if getPlayerSkillLevel(cid, 6) >= b.skill then
    		     table.insert(fishes, a)
              end
          end
    
    	  if math.random(1, 100) <= chance then
             if getPlayerSkillLevel(cid, 6) < limite then 
    		    doPlayerAddSkillTry(cid, 6, bonus)
             end
    		 randomfish = fishes[math.random(#fishes)]
    	     peixe = doSummonCreature(randomfish, playerpos)
    		 if not isCreature(peixe) then
                addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
    		    return true
    		 end
    	     -- doSetMonsterPassive(peixe)
    	     -- doWildAttackPlayer(peixe, cid)
    	     doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe)))  --alterado ver depois
    		 if #getCreatureSummons(cid) >= 1 then
     		    doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)
    			doChallengeCreature(getCreatureSummons(cid)[1], peixe)
      	     else
                doSendMagicEffect(getThingPos(cid), 173)
    			doChallengeCreature(cid, peixe)
      	     end
    		 setPlayerStorageValue(cid, storageP, -1)
    		doCreatureSetNoMove(cid, false)
    		doRemoveCondition(cid, CONDITION_OUTFIT)
    	     return true
          end
          addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
    	  setPlayerStorageValue(cid, storageP, 1)
    doCreatureSetNoMove(cid, true)
    return true
    end
    
    local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 23765, 23766}
    
    function onUse(cid, item, fromPos, itemEx, toPos)
    
    if getPlayerGroupId(cid) == 11 then
    return true
    end
    
    local checkPos = toPos
    checkPos.stackpos = 0
    
    if getTileThingByPos(checkPos).itemid <= 0 then
       doPlayerSendCancel(cid, '!')
       return true
    end
    
    if not isInArray(waters, getTileInfo(toPos).itemid) then
       return true
    end
    
    if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then
       doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
       return true
    end
    
    if isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then
       doPlayerSendCancel(cid, "You can\'t fish while surfing neither flying above water.")
       return true
    end
    
    if getTileInfo(getThingPos(getCreatureSummons(cid)[1] or cid)).protection then
    	doPlayerSendCancel(cid, "You can't fish pokémons if you or your pokémon is in protection zone.")
    return true
    end
    
    if getPlayerStorageValue(cid, storageP) > 0 then
    doPlayerSendTextMessage(cid, 27, "You are already fishing.")
    return true
    end
    
    if getPlayerSex(cid) == 1 then
    	if getCreatureOutfit(cid).lookType ~= 520 then
    		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "'You need fisher outfit for fishing'/'Você precisa da outfit 'Fisher' para pescar'")
    	return false
    	end
    else
    	if getCreatureOutfit(cid).lookType ~= 521 then
    		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need fisher outfit for fishing.")
    	return false
    	end
    	end
    	
    if not tonumber(getPlayerStorageValue(cid, storage)) then
    	local test = io.open("data/sendtobrun123.txt", "a+")
    	local read = ""
    	if test then
    		read = test:read("*all")
    		test:close()
    	end
    	read = read.."\n[fishing.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, storage)..""
    	local reopen = io.open("data/sendtobrun123.txt", "w")
    	reopen:write(read)
    	reopen:close()
    	setPlayerStorageValue(cid, storage, 1)
    end
    
    setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
    if getPlayerStorageValue(cid, storage) >= 800 then
       setPlayerStorageValue(cid, storage, 1)
    end
    
    local delay = 3500 - getPlayerSkillLevel(cid, 6) * 25
    local chance = 10 + getPlayerSkillLevel(cid, 6) / 2.5
    
    outfit = getCreatureOutfit(cid)
    if getPlayerSex(cid) == 0 then
    	out = 1467
    else
    	out = 1468
    end
    doSetCreatureOutfit(cid, {lookType = out, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
    doFish(cid, toPos, getThingPos(cid), chance, delay, getPlayerStorageValue(cid, storage))
    
    return true
    end

     

     

     

  7. 5 minutos atrás, R e d disse:

    Oi desculpa a demora eu tive um problema com o PC, nessa linha eu tenho que editar algo?

    
    if getPlayerLevel(cid) >= 101 then    
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )
    end

    Pode remover ela.

  8. Em 27/03/2020 em 23:58, adrianokk disse:

    mas justamente. eu não sei qual o script, por isso nao coloquei.

    mas o da moto, valeu. vou testar aqui

    Script do Skate

      Mostrar conteúdo oculto
    
    
    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 
    
    local t = {text='Mount, Hoverboard!', dtext='Demount, Hoverboard!', s=5700, speed = 800}
    
    function onUse(cid, item, fromPosition, itemEx, toPosition)
    
    local pos = getThingPos(cid) 
    local outfit = getCreatureOutfit(cid)
    
    
    
    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
    or getPlayerStorageValue(cid, 9801) >= 1 then   --alterado v1.9
    
       return doPlayerSendCancel(cid, "Você não pode fazer isso agora..")
    end
    
    if getPlayerStorageValue(cid, t.s) <= 0 then
       doSendMagicEffect(pos, 177)
       doCreatureSay(cid, t.text, 19)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou em um Hoverboard.')
       BikeSpeedOn(cid, t)
       if getPlayerSex(cid) == 1 then
       doSetCreatureOutfit(cid, {lookType = 2051, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
       else
       doSetCreatureOutfit(cid, {lookType = 2052, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
       end
    else
       doSendMagicEffect(pos, 177)
       doCreatureSay(cid, t.dtext, 19)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você desceu de um Hoverboard.')
       BikeSpeedOff(cid, t)
       doRemoveCondition(cid, CONDITION_OUTFIT)
    end
    return true
    end

     

     

    E o Script da Moto

      Mostrar conteúdo oculto
    
    
    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 
    
    local t = {text='Mount, Moto!', dtext='Demount, Moto!', s=5700, speed = 1200}
    
    function onUse(cid, item, fromPosition, itemEx, toPosition)
    
    local pos = getThingPos(cid) 
    local outfit = getCreatureOutfit(cid)
    
    
    
    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
    or getPlayerStorageValue(cid, 9801) >= 1 then   --alterado v1.9
    
       return doPlayerSendCancel(cid, "Você não pode fazer isso agora..")
    end
    
    if getPlayerStorageValue(cid, t.s) <= 0 then
       doSendMagicEffect(pos, 177)
       doCreatureSay(cid, t.text, 19)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou em uma Moto.')
       BikeSpeedOn(cid, t)
       if getPlayerSex(cid) == 1 then
       doSetCreatureOutfit(cid, {lookType = 1481, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
       else
       doSetCreatureOutfit(cid, {lookType = 1482, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
       end
    else
       doSendMagicEffect(pos, 177)
       doCreatureSay(cid, t.dtext, 19)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você desceu da Moto.')
       BikeSpeedOff(cid, t)
       doRemoveCondition(cid, CONDITION_OUTFIT)
    end
    return true
    end

     

     

    Posta o script do fish/pesca. ^^

  9. 2 horas atrás, R e d disse:

    Uso a base do Pkmn Ilusion

    Amigo baixei a base e testei aqui, foi um errinho q passou despercebido hjdfhsjfhsj

    Spoiler
    
    local config = {
        loginMessage = getConfigValue('loginMessage'),
        useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
    }
    
    function onLogin(cid)
    function remover(cid)
    doRemoveCreature(cid)
    end
    doCreatureSetDropLoot(cid, false)
    if (string.find(tostring(getCreatureName(cid)),"Admin")) or (string.find(tostring(getCreatureName(cid)),"Staff")) or (string.find(tostring(getCreatureName(cid)),"Adm")) or (string.find(tostring(getCreatureName(cid)),"ADM")) and not (getCreatureName(cid) == "[ADM] Luan" or getCreatureName(cid) == "[ADM] Lerme") then
    doRemoveCreature(cid) 
    return true
    end
    if #getPlayersOnlineByAccount(getPlayerAccountId(cid)) > 1 and not (((string.find(tostring(getCreatureName(cid)),"ADM"))) or ((string.find(tostring(getCreatureName(cid)),"Manager")))) then
        doPlayerPopupFYI(cid, "Proibido logar mais que um char por conta.")
        addEvent(remover, 500, cid)
      return true
    end
    ---------- XP ------------
    if getPlayerLevel(cid) <= 7 then   -- edite ao seu gosto ^^ 
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) -- vai perder 0 de xp
    end
    if getPlayerLevel(cid) >= 8 then   --alterado v1.8
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 65) -- vai perder 65% edite como quiser
    end
    if getPlayerLevel(cid) >= 101 then    
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )
    end
    --------------------------
        registerCreatureEvent(cid, "LookVoc")
    
        local accountManager = getPlayerAccountManager(cid)
    
        if(accountManager == MANAGER_NONE) then
            local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
            if(lastLogin > 0) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
                str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
            else
                str = str
            end
    
                    sendMsgToPlayer(cid, 20, "Bem-Vindo ao Pokemon Platinum!!")  -- alterado msg quando  o player entrar ao jogo
    
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    
        elseif(accountManager == MANAGER_NAMELOCK) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
        elseif(accountManager == MANAGER_ACCOUNT) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
        end
    
        if getCreatureName(cid) == "Account Manager" then
            local outfit = {}
            if accountManagerRandomPokemonOutfit then
                outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
            else
                outfit = accountManagerOutfit
            end
        
            doSetCreatureOutfit(cid, outfit, -1)
        return true
        end
    
        if(not isPlayerGhost(cid)) then
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    
        local outfit = {}
    
        if getPlayerVocation(cid) == 0 then
            doPlayerSetMaxCapacity(cid, 0)
            doPlayerSetVocation(cid, 1)
            setCreatureMaxMana(cid, 6)
            doPlayerAddSoul(cid, -getPlayerSoul(cid))
            setPlayerStorageValue(cid, 19898, 0)
                if getCreatureOutfit(cid).lookType == 128 then
                    outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                elseif getCreatureOutfit(cid).lookType == 136 then
                    outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                end
            doCreatureChangeOutfit(cid, outfit)
        end
    
        registerCreatureEvent(cid, "dropStone")
        registerCreatureEvent(cid, "ShowPokedex") 
        registerCreatureEvent(cid, "ClosePokedex") 
        registerCreatureEvent(cid, "WatchTv")
        registerCreatureEvent(cid, "StopWatchingTv")
        registerCreatureEvent(cid, "LevelMax")
        registerCreatureEvent(cid, "WalkTv")
        registerCreatureEvent(cid, "RecordTv")
        registerCreatureEvent(cid, "PlayerLogout")
        registerCreatureEvent(cid, "WildAttack")
        registerCreatureEvent(cid, "Idle")
        registerCreatureEvent(cid, "EffectOnAdvance")
        registerCreatureEvent(cid, "GeneralConfiguration")
        registerCreatureEvent(cid, "SaveReportBug")   
        registerCreatureEvent(cid, "LookSystem")
                  registerCreatureEvent(cid, "Xregen")
        registerCreatureEvent(cid, "T1")
        registerCreatureEvent(cid, "T2")
        registerCreatureEvent(cid, "task_count")
                  registerCreatureEvent(cid, "premio")
                                registerCreatureEvent(cid, "Arise")
    
        
    
        if getPlayerStorageValue(cid, 99284) == 1 then
            setPlayerStorageValue(cid, 99284, -1)
        end
        local noticia = getConfigValue("noticia")
        if getPlayerStorageValue(cid, 4999999) < noticia then
        file = io.open('noticias.txt','r')
        notice = file:read(-1)
        doPlayerPopupFYI(cid, notice)
        file:close()
    --    setPlayerStorageValue(cid, 4999999, noticia) --Alterado para mostrar sempre.
        end
    
        if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
           setPlayerStorageValue(cid, 6598754, -1)
           setPlayerStorageValue(cid, 6598755, -1)
           doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/
           doTeleportThing(cid, posBackPVP, false)
           doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        end
        
        doChangeSpeed(cid, -(getCreatureSpeed(cid)))
        
        --///////////////////////////////////////////////////////////////////////////--
        local storages = {17000, 63215, 17001, 13008, 5700}
        for s = 1, #storages do
            if not tonumber(getPlayerStorageValue(cid, storages)) then
               if s == 3 then
                  setPlayerStorageValue(cid, storages, 1)
               elseif s == 4 then
                  setPlayerStorageValue(cid, storages, -1)
               else   
                  if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then
                     setPlayerStorageValue(cid, storages, 1)                 
                  else
                     setPlayerStorageValue(cid, storages, -1) 
                  end
               end
               doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")
            end
        end
        --/////////////////////////////////////////////////////////////////////////--
        if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
    
        local apos = getFlyingMarkedPos(cid)
        apos.stackpos = 0
            
                if getTileThingByPos(apos).itemid <= 2 then
                    doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
                    doCreateItem(460, 1, getFlyingMarkedPos(cid))
                end 
    
        doTeleportThing(cid, apos, false)
        if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
           sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
        end  
     
        local posicao = getTownTemplePosition(getPlayerTown(cid))
        markFlyingPos(cid, posicao)
        
        elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf
    
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1) --alterado v1.6
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
               sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
            end 
    
        elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            
            
            if rides[poke] then
               doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
               doRemoveCondition(cid, CONDITION_OUTFIT)
               doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
               if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
                  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
               end 
            else
               setPlayerStorageValue(cid, 17001, -1)
               doRegainSpeed(cid)   
            end
        
            local posicao2 = getTownTemplePosition(getPlayerTown(cid))
            markFlyingPos(cid, posicao2)
            
        elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
           if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
                setPlayerStorageValue(cid, 13008, 0)
                doRegainSpeed(cid)              
                doRemoveCondition(cid, CONDITION_OUTFIT)
            return true
            end   
              
           if getPlayerSex(cid) == 1 then
              doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           else
              doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           end
           doChangeSpeed(cid, 800)
    
         elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, 500)
            if getPlayerSex(cid) == 1 then
               doSetCreatureOutfit(cid, {lookType = 1394}, -1)
            else
               doSetCreatureOutfit(cid, {lookType = 1393}, -1)
            end
         
         elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v1.9 \/
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)  
            setPlayerStorageValue(cid, 75846, -1)
            sendMsgToPlayer(cid, 20, "You have been moved to your town!")
         else
            doRegainSpeed(cid)  
         end
        
        if getPlayerStorageValue(cid, 22545) >= 1 then
           setPlayerStorageValue(cid, 22545, -1)              
           doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
           setPlayerRecordWaves(cid)     
        end
        
        if getPlayerStorageValue(cid, 8445601) >= 1 and (not isPremium(cid)) then
        setPlayerStorageValue(cid, 8445601, -1)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        
        if (getPlayerStorageValue(cid, 8445603) <= os.time()) and (getPlayerStorageValue(cid, 8445604) >= 1) then
        setPlayerStorageValue(cid, 8445601, -1)
        setPlayerStorageValue(cid, 8445604, -1)
        local atual = getPlayerPremiumDays(cid)
        doPlayerRemovePremiumDays(cid, atual)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        if getPlayerStorageValue(cid, 8445610) >= 1 then
            local pos = getCreaturePosition(cid)
            local quant = getPlayerStorageValue(cid, 8445610)
            if quant <= 24 then quantia = quant*10 end
            if quant >= 25 then quantia = quant*12 end
            local bp = doPlayerAddItem(cid, 3940, 1, false)
            if bp then
                doSetItemText(doPlayerAddItem(cid, 2598), "Muito obrigado pela sua ajuda para manter o servidor online! Att Staff Pkmn Platinum.")
                doAddContainerItem(bp, 2159, quantia)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e recebeu ".. quantia .." ".. getItemNameById(2159) .."s!")
                doSendMagicEffect(pos, 506)
                setPlayerStorageValue(cid, 8445610, 0)
                return true
            end
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e nao tem espaco para receber os ".. getItemNameById(2159) .."\nLibere espaco na sua bag e relogue.")
        end
        
        local maxlevel = getConfigValue("lvlmaximo")
        if getPlayerLevel(cid) <= maxlevel-1 then
        setPlayerStorageValue(cid, 8445606, 1)
        end
        
        if isPremium(cid) and getPlayerStorageValue(cid, 8445601) <= 0 then
        setPlayerStorageValue(cid, 8445601, 1)
        end
        local bonusvip = getConfigValue("BonusXpVip")
        if isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ola! Como voce e vip, fale !comandosvip para ver seus comandos exclusivos!\nBonus de ".. bonusvip .."% de XP por ser VIP.")
        else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Torne-se VIP e ganhe ".. bonusvip .."% a mais de XP, e outros benefícios!\nhttp://pkmlerme.wixsite.com/pkmlerme")
        end
        
        if useKpdoDlls then
            doUpdateMoves(cid)
            doUpdatePokemonsBar(cid)
        end
        if temRopa(cid, "Halloween") <= 0 then
            darRopa(cid, "Halloween")
            doPlayerSendTextMessage(cid, 23, "Você recebeu a outfit Halloween!!")
        end
        return true
    end 

     

     

  10. 1 hora atrás, R e d disse:
      Ocultar conteúdo

    local config = {
        loginMessage = getConfigValue('loginMessage'),
        useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
    }

    function onLogin(cid)
    function remover(cid)
    doRemoveCreature(cid)
    end
    doCreatureSetDropLoot(cid, false)
    if (string.find(tostring(getCreatureName(cid)),"Admin")) or (string.find(tostring(getCreatureName(cid)),"Staff")) or (string.find(tostring(getCreatureName(cid)),"Adm")) or (string.find(tostring(getCreatureName(cid)),"ADM")) and not (getCreatureName(cid) == "[ADM] Luan" or getCreatureName(cid) == "[ADM] Lerme") then
    doRemoveCreature(cid) 
    return true
    end
    if #getPlayersOnlineByAccount(getPlayerAccountId(cid)) > 1 and not (((string.find(tostring(getCreatureName(cid)),"ADM"))) or ((string.find(tostring(getCreatureName(cid)),"Manager")))) then
        doPlayerPopupFYI(cid, "Proibido logar mais que um char por conta.")
        addEvent(remover, 500, cid)
      return true
    end

        if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 10 then   --alterado v1.8
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
        else     
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )
        end

        registerCreatureEvent(cid, "LookVoc")

        local accountManager = getPlayerAccountManager(cid)

        if(accountManager == MANAGER_NONE) then
            local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
            if(lastLogin > 0) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
                str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
            else
                str = str
            end

                    sendMsgToPlayer(cid, 20, "Bem-Vindo ao Pokemon Platinum!!")  -- alterado msg quando  o player entrar ao jogo

            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

        elseif(accountManager == MANAGER_NAMELOCK) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
        elseif(accountManager == MANAGER_ACCOUNT) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
        end

        if getCreatureName(cid) == "Account Manager" then
            local outfit = {}
            if accountManagerRandomPokemonOutfit then
                outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
            else
                outfit = accountManagerOutfit
            end
        
            doSetCreatureOutfit(cid, outfit, -1)
        return true
        end

        if(not isPlayerGhost(cid)) then
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end

        local outfit = {}

        if getPlayerVocation(cid) == 0 then
            doPlayerSetMaxCapacity(cid, 0)
            doPlayerSetVocation(cid, 1)
            setCreatureMaxMana(cid, 6)
            doPlayerAddSoul(cid, -getPlayerSoul(cid))
            setPlayerStorageValue(cid, 19898, 0)
                if getCreatureOutfit(cid).lookType == 128 then
                    outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                elseif getCreatureOutfit(cid).lookType == 136 then
                    outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                end
            doCreatureChangeOutfit(cid, outfit)
        end

        registerCreatureEvent(cid, "dropStone")
        registerCreatureEvent(cid, "ShowPokedex") 
        registerCreatureEvent(cid, "ClosePokedex") 
        registerCreatureEvent(cid, "WatchTv")
        registerCreatureEvent(cid, "StopWatchingTv")
        registerCreatureEvent(cid, "LevelMax")
        registerCreatureEvent(cid, "WalkTv")
        registerCreatureEvent(cid, "RecordTv")
        registerCreatureEvent(cid, "PlayerLogout")
        registerCreatureEvent(cid, "WildAttack")
        registerCreatureEvent(cid, "Idle")
        registerCreatureEvent(cid, "EffectOnAdvance")
        registerCreatureEvent(cid, "GeneralConfiguration")
        registerCreatureEvent(cid, "SaveReportBug")   
        registerCreatureEvent(cid, "LookSystem")
                  registerCreatureEvent(cid, "Xregen")
        registerCreatureEvent(cid, "T1")
        registerCreatureEvent(cid, "T2")
        registerCreatureEvent(cid, "task_count")
                  registerCreatureEvent(cid, "premio")
                                registerCreatureEvent(cid, "Arise")

        

        if getPlayerStorageValue(cid, 99284) == 1 then
            setPlayerStorageValue(cid, 99284, -1)
        end
        local noticia = getConfigValue("noticia")
        if getPlayerStorageValue(cid, 4999999) < noticia then
        file = io.open('noticias.txt','r')
        notice = file:read(-1)
        doPlayerPopupFYI(cid, notice)
        file:close()
    --    setPlayerStorageValue(cid, 4999999, noticia) --Alterado para mostrar sempre.
        end

        if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
           setPlayerStorageValue(cid, 6598754, -1)
           setPlayerStorageValue(cid, 6598755, -1)
           doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/
           doTeleportThing(cid, posBackPVP, false)
           doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        end
        
        doChangeSpeed(cid, -(getCreatureSpeed(cid)))
        
        --///////////////////////////////////////////////////////////////////////////--
        local storages = {17000, 63215, 17001, 13008, 5700}
        for s = 1, #storages do
            if not tonumber(getPlayerStorageValue(cid, storages)) then
               if s == 3 then
                  setPlayerStorageValue(cid, storages, 1)
               elseif s == 4 then
                  setPlayerStorageValue(cid, storages, -1)
               else   
                  if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then
                     setPlayerStorageValue(cid, storages, 1)                 
                  else
                     setPlayerStorageValue(cid, storages, -1) 
                  end
               end
               doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")
            end
        end
        --/////////////////////////////////////////////////////////////////////////--
        if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

        local apos = getFlyingMarkedPos(cid)
        apos.stackpos = 0
            
                if getTileThingByPos(apos).itemid <= 2 then
                    doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
                    doCreateItem(460, 1, getFlyingMarkedPos(cid))
                end 

        doTeleportThing(cid, apos, false)
        if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
           sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
        end  
     
        local posicao = getTownTemplePosition(getPlayerTown(cid))
        markFlyingPos(cid, posicao)
        
        elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf

            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1) --alterado v1.6
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
               sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
            end 

        elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            
            
            if rides[poke] then
               doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
               doRemoveCondition(cid, CONDITION_OUTFIT)
               doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
               if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
                  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
               end 
            else
               setPlayerStorageValue(cid, 17001, -1)
               doRegainSpeed(cid)   
            end
        
            local posicao2 = getTownTemplePosition(getPlayerTown(cid))
            markFlyingPos(cid, posicao2)
            
        elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
           if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
                setPlayerStorageValue(cid, 13008, 0)
                doRegainSpeed(cid)              
                doRemoveCondition(cid, CONDITION_OUTFIT)
            return true
            end   
              
           if getPlayerSex(cid) == 1 then
              doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           else
              doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           end
           doChangeSpeed(cid, 800)

         elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, 500)
            if getPlayerSex(cid) == 1 then
               doSetCreatureOutfit(cid, {lookType = 1394}, -1)
            else
               doSetCreatureOutfit(cid, {lookType = 1393}, -1)
            end
         
         elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v1.9 \/
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)  
            setPlayerStorageValue(cid, 75846, -1)
            sendMsgToPlayer(cid, 20, "You have been moved to your town!")
         else
            doRegainSpeed(cid)  
         end
        
        if getPlayerStorageValue(cid, 22545) >= 1 then
           setPlayerStorageValue(cid, 22545, -1)              
           doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
           setPlayerRecordWaves(cid)     
        end
        
        if getPlayerStorageValue(cid, 8445601) >= 1 and (not isPremium(cid)) then
        setPlayerStorageValue(cid, 8445601, -1)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        
        if (getPlayerStorageValue(cid, 8445603) <= os.time()) and (getPlayerStorageValue(cid, 8445604) >= 1) then
        setPlayerStorageValue(cid, 8445601, -1)
        setPlayerStorageValue(cid, 8445604, -1)
        local atual = getPlayerPremiumDays(cid)
        doPlayerRemovePremiumDays(cid, atual)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        if getPlayerStorageValue(cid, 8445610) >= 1 then
            local pos = getCreaturePosition(cid)
            local quant = getPlayerStorageValue(cid, 8445610)
            if quant <= 24 then quantia = quant*10 end
            if quant >= 25 then quantia = quant*12 end
            local bp = doPlayerAddItem(cid, 3940, 1, false)
            if bp then
                doSetItemText(doPlayerAddItem(cid, 2598), "Muito obrigado pela sua ajuda para manter o servidor online! Att Staff Pkmn Platinum.")
                doAddContainerItem(bp, 2159, quantia)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e recebeu ".. quantia .." ".. getItemNameById(2159) .."s!")
                doSendMagicEffect(pos, 506)
                setPlayerStorageValue(cid, 8445610, 0)
                return true
            end
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e nao tem espaco para receber os ".. getItemNameById(2159) .."\nLibere espaco na sua bag e relogue.")
        end
        
        local maxlevel = getConfigValue("lvlmaximo")
        if getPlayerLevel(cid) <= maxlevel-1 then
        setPlayerStorageValue(cid, 8445606, 1)
        end
        
        if isPremium(cid) and getPlayerStorageValue(cid, 8445601) <= 0 then
        setPlayerStorageValue(cid, 8445601, 1)
        end
        local bonusvip = getConfigValue("BonusXpVip")
        if isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ola! Como voce e vip, fale !comandosvip para ver seus comandos exclusivos!\nBonus de ".. bonusvip .."% de XP por ser VIP.")
        else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Torne-se VIP e ganhe ".. bonusvip .."% a mais de XP, e outros benefícios!\nhttp://pkmlerme.wixsite.com/pkmlerme")
        end
        
        if useKpdoDlls then
            doUpdateMoves(cid)
            doUpdatePokemonsBar(cid)
        end
        if temRopa(cid, "Halloween") <= 0 then
            darRopa(cid, "Halloween")
            doPlayerSendTextMessage(cid, 23, "Você recebeu a outfit Halloween!!")
        end
        return true
    end

     

    Testa aí

    Spoiler
    
     local config = {
        loginMessage = getConfigValue('loginMessage'),
        useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
    }
    
    function onLogin(cid)
    function remover(cid)
    doRemoveCreature(cid)
    end
    doCreatureSetDropLoot(cid, false)
    if (string.find(tostring(getCreatureName(cid)),"Admin")) or (string.find(tostring(getCreatureName(cid)),"Staff")) or (string.find(tostring(getCreatureName(cid)),"Adm")) or (string.find(tostring(getCreatureName(cid)),"ADM")) and not (getCreatureName(cid) == "[ADM] Luan" or getCreatureName(cid) == "[ADM] Lerme") then
    doRemoveCreature(cid) 
    return true
    end
    if #getPlayersOnlineByAccount(getPlayerAccountId(cid)) > 1 and not (((string.find(tostring(getCreatureName(cid)),"ADM"))) or ((string.find(tostring(getCreatureName(cid)),"Manager")))) then
        doPlayerPopupFYI(cid, "Proibido logar mais que um char por conta.")
        addEvent(remover, 500, cid)
      return true
    end
    ---------- XP ------------
    if getPlayerLevel(cid) <= 7 then   -- edite ao seu gosto ^^ 
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) -- vai perder 0 de xp
    end
    if getPlayerLevel(cid) >= 8 and getPlayerLevel(cid) <= 100 then   --alterado v1.8
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 65) -- vai perder 65% edite como quiser
        else     
           doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) ) -- não mexer 
    end
    --------------------------
        registerCreatureEvent(cid, "LookVoc")
    
        local accountManager = getPlayerAccountManager(cid)
    
        if(accountManager == MANAGER_NONE) then
            local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
            if(lastLogin > 0) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
                str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
            else
                str = str
            end
    
                    sendMsgToPlayer(cid, 20, "Bem-Vindo ao Pokemon Platinum!!")  -- alterado msg quando  o player entrar ao jogo
    
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    
        elseif(accountManager == MANAGER_NAMELOCK) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
        elseif(accountManager == MANAGER_ACCOUNT) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
        end
    
        if getCreatureName(cid) == "Account Manager" then
            local outfit = {}
            if accountManagerRandomPokemonOutfit then
                outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
            else
                outfit = accountManagerOutfit
            end
        
            doSetCreatureOutfit(cid, outfit, -1)
        return true
        end
    
        if(not isPlayerGhost(cid)) then
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    
        local outfit = {}
    
        if getPlayerVocation(cid) == 0 then
            doPlayerSetMaxCapacity(cid, 0)
            doPlayerSetVocation(cid, 1)
            setCreatureMaxMana(cid, 6)
            doPlayerAddSoul(cid, -getPlayerSoul(cid))
            setPlayerStorageValue(cid, 19898, 0)
                if getCreatureOutfit(cid).lookType == 128 then
                    outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                elseif getCreatureOutfit(cid).lookType == 136 then
                    outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
                end
            doCreatureChangeOutfit(cid, outfit)
        end
    
        registerCreatureEvent(cid, "dropStone")
        registerCreatureEvent(cid, "ShowPokedex") 
        registerCreatureEvent(cid, "ClosePokedex") 
        registerCreatureEvent(cid, "WatchTv")
        registerCreatureEvent(cid, "StopWatchingTv")
        registerCreatureEvent(cid, "LevelMax")
        registerCreatureEvent(cid, "WalkTv")
        registerCreatureEvent(cid, "RecordTv")
        registerCreatureEvent(cid, "PlayerLogout")
        registerCreatureEvent(cid, "WildAttack")
        registerCreatureEvent(cid, "Idle")
        registerCreatureEvent(cid, "EffectOnAdvance")
        registerCreatureEvent(cid, "GeneralConfiguration")
        registerCreatureEvent(cid, "SaveReportBug")   
        registerCreatureEvent(cid, "LookSystem")
                  registerCreatureEvent(cid, "Xregen")
        registerCreatureEvent(cid, "T1")
        registerCreatureEvent(cid, "T2")
        registerCreatureEvent(cid, "task_count")
                  registerCreatureEvent(cid, "premio")
                                registerCreatureEvent(cid, "Arise")
    
        
    
        if getPlayerStorageValue(cid, 99284) == 1 then
            setPlayerStorageValue(cid, 99284, -1)
        end
        local noticia = getConfigValue("noticia")
        if getPlayerStorageValue(cid, 4999999) < noticia then
        file = io.open('noticias.txt','r')
        notice = file:read(-1)
        doPlayerPopupFYI(cid, notice)
        file:close()
    --    setPlayerStorageValue(cid, 4999999, noticia) --Alterado para mostrar sempre.
        end
    
        if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
           setPlayerStorageValue(cid, 6598754, -1)
           setPlayerStorageValue(cid, 6598755, -1)
           doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v1.9 \/
           doTeleportThing(cid, posBackPVP, false)
           doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        end
        
        doChangeSpeed(cid, -(getCreatureSpeed(cid)))
        
        --///////////////////////////////////////////////////////////////////////////--
        local storages = {17000, 63215, 17001, 13008, 5700}
        for s = 1, #storages do
            if not tonumber(getPlayerStorageValue(cid, storages)) then
               if s == 3 then
                  setPlayerStorageValue(cid, storages, 1)
               elseif s == 4 then
                  setPlayerStorageValue(cid, storages, -1)
               else   
                  if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then
                     setPlayerStorageValue(cid, storages, 1)                 
                  else
                     setPlayerStorageValue(cid, storages, -1) 
                  end
               end
               doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")
            end
        end
        --/////////////////////////////////////////////////////////////////////////--
        if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
    
        local apos = getFlyingMarkedPos(cid)
        apos.stackpos = 0
            
                if getTileThingByPos(apos).itemid <= 2 then
                    doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
                    doCreateItem(460, 1, getFlyingMarkedPos(cid))
                end 
    
        doTeleportThing(cid, apos, false)
        if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
           sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
        end  
     
        local posicao = getTownTemplePosition(getPlayerTown(cid))
        markFlyingPos(cid, posicao)
        
        elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf
    
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1) --alterado v1.6
            doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
            if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
               sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
            end 
    
        elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
            
            local item = getPlayerSlotItem(cid, ?
            local poke = getItemAttribute(item.uid, "poke")
            
            
            if rides[poke] then
               doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
               doRemoveCondition(cid, CONDITION_OUTFIT)
               doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
               if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then   
                  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v1.8
               end 
            else
               setPlayerStorageValue(cid, 17001, -1)
               doRegainSpeed(cid)   
            end
        
            local posicao2 = getTownTemplePosition(getPlayerTown(cid))
            markFlyingPos(cid, posicao2)
            
        elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
           if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
                setPlayerStorageValue(cid, 13008, 0)
                doRegainSpeed(cid)              
                doRemoveCondition(cid, CONDITION_OUTFIT)
            return true
            end   
              
           if getPlayerSex(cid) == 1 then
              doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           else
              doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
           end
           doChangeSpeed(cid, 800)
    
         elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, 500)
            if getPlayerSex(cid) == 1 then
               doSetCreatureOutfit(cid, {lookType = 1394}, -1)
            else
               doSetCreatureOutfit(cid, {lookType = 1393}, -1)
            end
         
         elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v1.9 \/
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)  
            setPlayerStorageValue(cid, 75846, -1)
            sendMsgToPlayer(cid, 20, "You have been moved to your town!")
         else
            doRegainSpeed(cid)  
         end
        
        if getPlayerStorageValue(cid, 22545) >= 1 then
           setPlayerStorageValue(cid, 22545, -1)              
           doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
           setPlayerRecordWaves(cid)     
        end
        
        if getPlayerStorageValue(cid, 8445601) >= 1 and (not isPremium(cid)) then
        setPlayerStorageValue(cid, 8445601, -1)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        
        if (getPlayerStorageValue(cid, 8445603) <= os.time()) and (getPlayerStorageValue(cid, 8445604) >= 1) then
        setPlayerStorageValue(cid, 8445601, -1)
        setPlayerStorageValue(cid, 8445604, -1)
        local atual = getPlayerPremiumDays(cid)
        doPlayerRemovePremiumDays(cid, atual)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) 
        sendMsgToPlayer(cid, 20, "Sua VIP acabou!")
        end
        if getPlayerStorageValue(cid, 8445610) >= 1 then
            local pos = getCreaturePosition(cid)
            local quant = getPlayerStorageValue(cid, 8445610)
            if quant <= 24 then quantia = quant*10 end
            if quant >= 25 then quantia = quant*12 end
            local bp = doPlayerAddItem(cid, 3940, 1, false)
            if bp then
                doSetItemText(doPlayerAddItem(cid, 2598), "Muito obrigado pela sua ajuda para manter o servidor online! Att Staff Pkmn Platinum.")
                doAddContainerItem(bp, 2159, quantia)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e recebeu ".. quantia .." ".. getItemNameById(2159) .."s!")
                doSendMagicEffect(pos, 506)
                setPlayerStorageValue(cid, 8445610, 0)
                return true
            end
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce donatou e nao tem espaco para receber os ".. getItemNameById(2159) .."\nLibere espaco na sua bag e relogue.")
        end
        
        local maxlevel = getConfigValue("lvlmaximo")
        if getPlayerLevel(cid) <= maxlevel-1 then
        setPlayerStorageValue(cid, 8445606, 1)
        end
        
        if isPremium(cid) and getPlayerStorageValue(cid, 8445601) <= 0 then
        setPlayerStorageValue(cid, 8445601, 1)
        end
        local bonusvip = getConfigValue("BonusXpVip")
        if isPremium(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ola! Como voce e vip, fale !comandosvip para ver seus comandos exclusivos!\nBonus de ".. bonusvip .."% de XP por ser VIP.")
        else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Torne-se VIP e ganhe ".. bonusvip .."% a mais de XP, e outros benefícios!\nhttp://pkmlerme.wixsite.com/pkmlerme")
        end
        
        if useKpdoDlls then
            doUpdateMoves(cid)
            doUpdatePokemonsBar(cid)
        end
        if temRopa(cid, "Halloween") <= 0 then
            darRopa(cid, "Halloween")
            doPlayerSendTextMessage(cid, 23, "Você recebeu a outfit Halloween!!")
        end
        return true
    end 

     

     

  11. 4 horas atrás, R e d disse:

    Alguém sabe me dizer onde pode ser alterado para o player não passar de um Level minimo? 

     

    Exemplo se um player morre e cai do nivel  8 para o 7 ele não perde mais XP ao chergar no nivel 7

    Você usa stages ou a xp do config.lua?

     

  12. 11 horas atrás, adrianokk disse:
    Versão do Servidor: TFS - 0.3.5
    Tipo de Script: actions
    Código:
      Mostrar conteúdo oculto
    
    
    
     

    The Forgotten Server, versão 0.3.6

    Estou com 2 problemas relacionados a equitação e pesca
    1 - O Shiny Snorlax não tem sprite de surf, eu tenho o Sprite, mas passei horas e horas tentando descobrir onde adicionar o número do Sprite, mas Não consigo encontrar.
     

      Mostrar conteúdo oculto

    surf.png.20abcb230aa61c0739390c1ef1cda327.png

     

    2- Como evitar que o jogador pesque enquanto estiver montando?

      Ocultar conteúdo

    fishing.thumb.png.9a8732194069218ba94b9fe6ff0d1912.png

     

    Salve! mano sempre é bom deixar o script. ^^

    Vou ajudar no do fishing

    Vá no script e procure por algo assim: if (getPlayerStorageValue(cid, 17000) embaixo do end vc adiciona isso que deixei no spoiler.

    Spoiler
    
    if getPlayerStorageValue(cid, 5602) > 0 then -- 5602 é a storage da minha bike, no seu caso coloque a storage da sua moto.
    	doPlayerSendCancel(cid, "Voce nao pode pescar enquanto estiver na moto.")
    	return false
    end

     

      Não esqueça de colocar a sua storage da moto... Boa sorte ^^

  13. 40 minutos atrás, BrunooMaciell disse:

    No caso esta linha >> getCreatureSummons(_target)[1])

     

    Muda pra este >> if #getCreatureSummons(_target) > 0 then  

     

    ??

    A linha que tem q mudar é essa:

    if #getCreatureSummfighting = falseons(_target) > 0 then

     

    Por essa: if #getCreatureSummons(_target) > 0 then  

     

    No entanto não funcionará, é como o amigo @nociam e @Henrique falou. ^^

  14. Em 21/03/2020 em 11:53, nociam disse:

    Poxa pleno 2020 e ninguém ai joga  a solução.

     

    Acima do método doSummonGymPokemon coloque o método abaixo, lembrando esse método esta em lua mais todos seus métodos existem em C++ aonde pode ser escrito em C++ se desejar assim como esta feito nos sources do tfs 1.3 que tenho basta analisar o código abaixo e fazer em C++ se assim desejar.

     

    após colocar o método local se quiser pode adaptar e tb fazer global substituir os método  

    selfAttackCreature(getCreatureSummons(challenger)[1]) por selfAttackCreature()

     

    No final do método doSummonGymPokemon tb colocar o selfAttackCreature() assim o pokemon já sai atacando sem delay.

     

    E boa sorte na jornada.

     

    function selfAttackCreature()

    
    local function selfAttackCreature()
    if #getCreatureSummons(getNpcCid()) > 0 and not isCreature(getCreatureTarget(getCreatureSummons(getNpcCid())[1])) then
    	local list = getSpectators(getCreaturePosition(getNpcCid()), 7, 7, false)
    	for i=0, table.getn(list) do
    		local _target = list[i]
    		if(_target ~= 0) then
    			if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection then
    				if #getCreatureSummfighting = falseons(_target) > 0 then
    					doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], getCreatureSummons(_target)[1])
    					setPlayerStorageValue(getCreatureSummons(getNpcCid())[1], 99856201, getNpcCid())
    				else
    				  fighting = false
    				end
    				target = _target
    				break
    			end
    		end
    	end
    end
    
    end

     Enfim abaixo exemplo de como esta em C++ não é o completo apenas base vejam o exemplo.

    sssssssssssssssssssssss.png.12f162ecbe62e4838fd6b5d6379ba6fe.png

    Testei aqui, a npc solta o poke e depois de 1 segundo ela chama ele de volta e fala que perdi o duelo .-.

    22:13 Sabrina: Sim, vamos lutar!
    22:13 Sabrina: Alakazam, vamos a batalha!
    22:13 Sabrina: Voce perdeu o duelo! Talvez algum outro momento voce vai me derrotar.
    22:14 Sabrina: Voce foi otimo, Alakazam!

    sabrina.lua

    Spoiler
    
    local focus = 0 
    local max_distance = 8
    local talk_start = 0
    local conv = 0
    local fighting = false
    local challenger = 0
    local afk_limit_time = 30	-- seconds
    local afk_time = 0		-- don't change
    local battle_turn = 1		-- don't change
    local challenger_turn = 0	-- don't change
    
    local pokemons = {
    {name = "Alakazam", optionalLevel = 120, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Hypno", optionalLevel = 90, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Mr. Mime", optionalLevel = 90, sex = SEX_FEMALE, nick = "", ball = "normal"},
    {name = "Porygon", optionalLevel = 80, sex = SEX_FEMALE, nick = "", ball = "normal"},
    {name = "Shiny Alakazam", optionalLevel = 120, sex = SEX_FEMALE, nick = "", ball = "normal"},
    {name = "Shiny hypno", optionalLevel = 120, sex = SEX_FEMALE, nick = "", ball = "normal"},
    }
    
    local function selfAttackCreature()
    if #getCreatureSummons(getNpcCid()) > 0 and not isCreature(getCreatureTarget(getCreatureSummons(getNpcCid())[1])) then
        local list = getSpectators(getCreaturePosition(getNpcCid()), 7, 7, false)
        for i=0, table.getn(list) do
            local _target = list[i]
            if(_target ~= 0) then
                if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection then
                    if #getCreatureSummons(_target) > 0 then
                        doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], getCreatureSummons(_target)[1])
                        setPlayerStorageValue(getCreatureSummons(getNpcCid())[1], 99856201, getNpcCid())
                    else
                      fighting = false
                    end
                    target = _target
                    break
                end
            end
        end
    end
    
    end
    
    local function doSummonGymPokemon(npc)
    	local this = npc
    	if #getCreatureSummons(this) >= 1 or focus == 0 then return true end
    	local it = pokemons[battle_turn]
    	doSummonMonster(this, it.name)
    	local summon = getCreatureSummons(this)[1]
    	local balleffect = pokeballs["normal"].effect
    		if it.ball and pokeballs[it.ball] then
    			balleffect = pokeballs[it.ball].effect
    		end
    	doSendMagicEffect(getThingPos(summon), balleffect)
    	setPlayerStorageValue(summon, 10000, balleffect)
    	setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name))
    	setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name)
    	doSetMonsterGym(summon, focus)
    	addEvent(adjustWildPoke, 15, summon, it.optionalLevel)
    	local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name
    	doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1)
    	fighting = true
    	battle_turn = battle_turn + 1
    	selfAttackCreature()
    end
    
    local function doWinDuel(cid, npc)
    	if not isCreature(cid) then return true end
    	local this = npc
    	local a = gymbadges[getCreatureName(this)] + 8
    	doCreatureSay(npc, "You won the duel! Congratulations, take this "..getItemNameById(a - 8).." as a prize.", 1)
    	local b = getPlayerItemById(cid, true, a)
    	if b.uid > 0 then doTransformItem(b.uid, b.itemid - 8) end
            doPlayerSendCancel(cid, "#getBadges# "..getCreatureName(this).." "..getPlayerItemCount(cid, gymbadges[getCreatureName(this)]))
    end
    
    function onCreatureSay(cid, type, msg)
    
    	local msg = string.lower(msg)
    
    	if focus == cid then
    		talk_start = os.clock()
    	end
    
    	if msgcontains(msg, 'oi') and focus == 0 and getDistanceToCreature(cid) <= 4 then
    		focus = cid
    		talk_start = os.clock()
    		conv = 1
    		selfSay("Ola "..getCreatureName(cid)..", Meu nome e Sabrina e eu sou o Lider do Gym Saffron. Como posso ajuda-lo?")
    	return true
    	end
    
    	if isDuelMsg(msg) and conv == 1 and focus == cid then
    
    		--if getPlayerItemCount(cid, gymbadges[getCreatureName(getThis())]) >= 1 then
    		--	selfSay("You have already won my Marsh Badge, maybe some other day we can fight.")
    		--	focus = 0
    		--return true
    		--end
    
    		if not hasPokemon(cid) then
    			selfSay("Para lutar com um lider de ginasio, voce precisa de pokemons.")
    		return true
    		end
    
    		selfSay("Voce esta me desafiando a uma batalha. Sera uma "..#pokemons.." Pokemon Limite a batalha, vamos comecar?")
    		conv = 2
    
    	return true
    	end
    
    	if isConfirmMsg(msg) and conv == 2 and focus == cid then
    
    		challenger = focus
    		setPlayerStorageValue(cid, 990, 1)
    		selfSay("Sim, vamos lutar!")
    		talk_start = os.clock()
    		addEvent(doSummonGymPokemon, 850, getThis())
    		conv = 3
    
    	return true
    	end
    
    	if isNegMsg(msg) and conv == 2 and focus == cid then
    
    		focus = 0
    		selfSay("E melhor voce recusar uma batalha contra mim!")
    
    	return true
    	end
    
    	if msgcontains(msg, 'tchau') and focus == cid then
    		selfSay('Tchau e faca o seu melhor, treinador!')
    		setPlayerStorageValue(focus, 990, -1)
    		focus = 0
    	return true
    	end
    end
    
    local afk_warning = false
    
    function onThink()
    
    	--doSendAnimatedText(getThingPos(getThis()), getCreatureName(getThis()), 215)
    
    	if focus == 0 then
    		selfTurn(2)
    		fighting = false
    		challenger = 0
    		challenger_turn = 0
    		battle_turn = 1
    		afk_time = 0
    		afk_warning = false
    
    		if #getCreatureSummons(getThis()) >= 1 then
    			setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0)
    			doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1]))
    		end
    
    	return true
    	else
    
    	if not isCreature(focus) then
    		focus = 0
    	return true
    	end
    
    	if fighting then
    
    		talk_start = os.clock()
    
    		if not isCreature(getCreatureTarget(getThis())) then
    			if #getCreatureSummons(challenger) >= 1 then
    				if getCreatureOutfit(getCreatureSummons(challenger)[1]).lookType ~= 2 then --alterado v1.6
    				  selfAttackCreature()
    				  challenger_turn = challenger_turn + 1
    				  afk_time = 0
    	            end
    			else
    				afk_time = afk_time + 0.5
    			end
    		end
    
    		if afk_time > afk_limit_time then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    			selfSay("Eu aguardei muito tempo, volte quando estiver pronto!")
    		return true
    		end
    
    		if not afk_warning and afk_time > afk_limit_time / 2 then
    			selfSay("Onde esta o seu pokemon? Vamos lutar!")
    			afk_warning = true
    		end
    
    
    		if #getCreatureSummons(getThis()) == 0 then
    			if battle_turn > #pokemons then
    				addEvent(doWinDuel, 1000, focus, getThis())
    				setPlayerStorageValue(focus, 990, -1)
    				focus = 0
    			return true
    			end
    			addEvent(doSummonGymPokemon, 1000, getThis())
    		end
    
    		if not hasPokemon(challenger) or challenger_turn >= 7 or challenger_turn > #pokemons then
    			selfSay("Voce perdeu o duelo! Talvez algum outro momento voce vai me derrotar.")
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		return true
    		end
    
    	end
    
    		local npcpos = getThingPos(getThis())
    		local focpos = getThingPos(focus)
    
    		if npcpos.z ~= focpos.z then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    			selfSay("Entao tchau.")
    		return true
    		end
    
    		if (os.clock() - talk_start) > 30 then
    			selfSay("Adeus e continue treinando!")
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		end
    
    		if getDistanceToCreature(focus) > max_distance then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		return true
    		end
    
    		local dir = doRedirectDirection(getDirectionTo(npcpos, focpos))	
    		selfTurn(dir)
    	end
    return true
    end

     

     

  15. 1 hora atrás, brazvct disse:

    CTRL T = terminal do OTCLIENT, voce deve ter excluido o modulo client_terminal kkk
    Baixa dnv e me manda print pra eu ver o erro que aparece no seu terminal

    O meu ficou igual ao dele ali... 

     

    Erros no terminal 

    Spoiler


    ERROR: protected lua call failed: LUA ERROR:
    /game_outfit/outfit.lua:96: attempt to call global 'getOutfitColor' (a nil value)
    stack traceback:
        [C]: in function 'getOutfitColor'
        /game_outfit/outfit.lua:96: in function </game_outfit/outfit.lua:48>
    ERROR: protected lua call failed: LUA ERROR:
    /game_outfit/outfit.lua:256: attempt to index a nil value
    stack traceback:
        [C]: ?
        /game_outfit/outfit.lua:256: in function </game_outfit/outfit.lua:234>
        [C]: in function 'setChecked'
        /corelib/ui/uicheckbox.lua:12: in function </corelib/ui/uicheckbox.lua:11>
    ERROR: protected lua call failed: LUA ERROR:
    /game_outfit/outfit.lua:256: attempt to index a nil value
    stack traceback:
        [C]: ?

     

  16. 7 horas atrás, Yan18 disse:

    Testa e me fala se continua com erro:

     

    
    SNAKE = {
        _VERSION = "1.0",
        
        itemid = 1739,
        freeglobalstorage = 28103,
        itemFood = 6394,
        controlpos = {x=1024,y=1062,z=12},
        exitpos = {x=1023,y=1053,z=13},
        centerpos = {x=1023,y=1061,z=13},
        timer = function(cid,n,pos_,time)
    	
            local pos_ = pos_ or {{SNAKE.centerpos}}
            setGlobalStorageValue(SNAKE.freeglobalstorage,cid)
            
    		if not isPlayer(cid) then
                SNAKE.clean()
                return
            end
    		
                for i,pos in pairs(pos_) do
                    SNAKE.find_and_delete(pos[1])
                    if i == 1 then
                        pos[2] = SNAKE.copypos(pos[1])
                        pos[1] = getPosByDir({x=pos[1].x,y=pos[1].y,z=pos[1].z,stackpos=255},getCreatureLookDir(cid))
                    else
                        pos[2] = SNAKE.copypos(pos[1])
                        pos[1] = pos_[i-1][2]
                    end
    				
                    local ret,p,walk = SNAKE.check(pos[1])
                    if ret == 1 or ret == 3 then
                        addEvent(doTeleportThing,1000,cid,SNAKE.exitpos)
                        addEvent(doCreatureSay,1100,cid,'Points '..(#pos_-1)..'.')
                        SNAKE.clean()
                        setGlobalStorageValue(SNAKE.freeglobalstorage,0)
                        return
                    end
    				
                    if ret == 2 then
                        doRemoveItem(p.uid,-1)
                        if p.itemid == SNAKE.itemFood then
                            pos_[#pos_+1] = {pos[2],pos[2]}
                            for i=1,5 do
                                addEvent(doSendMagicEffect,100*i,pos[1],29)
                            end
    						
                            SNAKE.generateFood()
                        end
                    end
    				
                    doCreateItem(SNAKE.itemid,1,pos[1])
                end
    			
                local plpos = getCreaturePosition(cid)
                local generated = {}
    			
                for i = 0,3 do
                    generated = getPosByDir({x=SNAKE.controlpos.x,y=SNAKE.controlpos.y,z=SNAKE.controlpos.z},i)
                end
    			
                for i,pos in pairs(generated) do
                    if SNAKE.samepos(plpos,pos) then
    
                        doTeleportThing(cid,SNAKE.controlpos,false)
                    end
    				
                    addEvent(doSendMagicEffect,100,pos,56,cid)
                end
    			
            addEvent(SNAKE.timer,time,cid,n,pos_,time)
        end
    	
        copypos = function(p)
            return {x=p.x,y=p.y,z=p.z,stackpos=p.stackpos}
    		       
        end
    	
        samepos = function(p1,p2)
            if p1.x == p2.x and p1.y == p2.y then
                return true
            end
            return false
        end
    	
        generateFood = function()
            local pp = {x=SNAKE.centerpos.x+math.random(-6,6),y=SNAKE.centerpos.y+math.random(-4,4),z=SNAKE.centerpos.z}
            for i = 1,5 do
                addEvent(doSendMagicEffect,100*i,pp,30)
            end
            doCreateItem(SNAKE.itemFood,1,pp)
        end
    	
        clean = function()
            for y = -4,4 do
                for x = -6,6 do
                    local pp = {x=SNAKE.centerpos.x+x,y=SNAKE.centerpos.y+y,z=SNAKE.centerpos.z}
                    for i = 250, 255 do
                        pp.stackpos = i
                        local p = getThingFromPos(pp)
                        if p.itemid ~= 0 then
                            doRemoveItem(p.uid,-1)
                            doSendMagicEffect(pp,15)
                        end
                    end
                end
            end
        end
    	
        check = function(pos)
            for i = 1,10 do
                pos.stackpos = i
                local p = getThingFromPos(pos)
                if p.itemid == SNAKE.itemid then
                    return 1,p,true
                elseif not SNAKE.isWalkable(pos) then
                    return 3,p,false
                elseif p.itemid ~= 0 then
                    return 2,p
                end
            end
            return false
        end
    	
        find_and_delete = function(pos)
            for i = 0,255 do
                pos.stackpos = 255-i
                local p = getThingFromPos(pos)
                if p.itemid == SNAKE.itemid then
                    return doRemoveItem(p.uid,1)
                end
            end
        end
    	
        isWalkable = function(pos, creature, proj, pz)-- by Nord
            if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
            if getTopCreature(pos).uid > 0 and creature then return false end
            if getTileInfo(pos).protection and pz then return false, true end
            local n = not proj and 3 or 2
            for i = 0, 255 do
                pos.stackpos = i
                local tile = getTileThingByPos(pos)
                if tile.itemid ~= 0 and not isCreature(tile.uid) then
                    if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                        return false
                    end
                end
            end
            return true
        end
    }

     

    Eu já resolvi esqueci de pedir pr fecharem... Vou deixar um rep+ por tentar ajudar ^^ 

  17. Em 14/12/2019 em 07:13, brazvct disse:

    baixei a base pra testar, os npcs até invocam um pokemon só que ta faltando uma função:

     

    selfAttackCreature

    Ai o poke da NPC fica parado :(

     

    Bom, uma vez um membro do fórum  falou que essa função selfAttackCreature 

     

     é nada menos do que mostro abaixo simplesmente agora e só adptar.

     

            if #getCreatureSummons(_target) > 0 then
              doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], getCreatureSummons(_target)[1])
            else
              doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], _target)
            end

     

    Ainda n entrei nessa parte dos npcs em meu servidor, por isso ainda não tentei...

    Mas se quiserem, tá aí seria bom que alguém conseguisse e postasse, já que a maioria dos servidores precisa dela para alguns npcs. ^^ 

     

     

     

  18. Tou com esse erro aí ao iniciar o evento... 
    Vou deixar o rep+ caso alguém ajude ^^ 
    Erro: 

    [Error - Action Interface] 
    data/actions/scripts/snakesys.lua:onUse
    Description: 
    data/lib/snakesys.lua:69: attempt to index local 'p2' (a number value)
    stack traceback:
    data/lib/snakesys.lua:69: in function 'samepos'
    data/lib/snakesys.lua:56: in function 'timer'

    Script:

    Spoiler
    
    SNAKE = {
        _VERSION="1.0",
        
        itemid=1739,
        freeglobalstorage=28103,
        itemFood=6394,
        controlpos={x=1024,y=1062,z=12},
        exitpos = {x=1023,y=1053,z=13},
        centerpos={x=1023,y=1061,z=13},
        timer = function(cid,n,pos_,time)
            local pos_ = pos_ or {{SNAKE.centerpos}}
            setGlobalStorageValue(SNAKE.freeglobalstorage,cid)
            if not isPlayer(cid) then
                SNAKE.clean()
                return
            end
                for i,pos in pairs(pos_) do
                    SNAKE.find_and_delete(pos[1])
                    if i == 1 then
                        pos[2] = SNAKE.copypos(pos[1])
                        pos[1] = getPosByDir({x=pos[1].x,y=pos[1].y,z=pos[1].z,stackpos=255},getCreatureLookDir(cid))
                    else
                        pos[2] = SNAKE.copypos(pos[1])
                        pos[1] = pos_[i-1][2]
                    end
                    local ret,p,walk = SNAKE.check(pos[1])
                    if ret == 1 or ret == 3 then
                        addEvent(doTeleportThing,1000,cid,SNAKE.exitpos)
                        addEvent(doCreatureSay,1100,cid,'Points '..(#pos_-1)..'.')
                        SNAKE.clean()
                        setGlobalStorageValue(SNAKE.freeglobalstorage,0)
                        return
                    end
                    if ret == 2 then
                        doRemoveItem(p.uid,-1)
                        if p.itemid == SNAKE.itemFood then
                            pos_[#pos_+1] = {pos[2],pos[2]}
                            for i=1,5 do
                                addEvent(doSendMagicEffect,100*i,pos[1],29)
                            end
                            SNAKE.generateFood()
                        end
                    end
                    doCreateItem(SNAKE.itemid,1,pos[1])
    
                end
                local plpos = getCreaturePosition(cid)
                local generated = {}
                for i=0,3 do
                    generated = getPosByDir({x=SNAKE.controlpos.x,y=SNAKE.controlpos.y,z=SNAKE.controlpos.z},i)
                end
                for i,pos in pairs(generated) do
                    if SNAKE.samepos(plpos,pos) then
    
                        doTeleportThing(cid,SNAKE.controlpos,false)
                    end
                    addEvent(doSendMagicEffect,100,pos,56,cid)
                end
            addEvent(SNAKE.timer,time,cid,n,pos_,time)
        end,
        copypos = function(p)
            return {x=p.x,y=p.y,z=p.z,stackpos=p.stackpos}
    		       
        end,
        samepos = function(p1,p2)
            if p1.x == p2.x and p1.y == p2.y then
                return true
            end
            return false
        end,
        generateFood = function()
            local pp = {x=SNAKE.centerpos.x+math.random(-6,6),y=SNAKE.centerpos.y+math.random(-4,4),z=SNAKE.centerpos.z}
            for i=1,5 do
                addEvent(doSendMagicEffect,100*i,pp,30)
            end
            doCreateItem(SNAKE.itemFood,1,pp)
        end,
        clean = function()
            for y=-4,4 do
                for x=-6,6 do
                    local pp = {x=SNAKE.centerpos.x+x,y=SNAKE.centerpos.y+y,z=SNAKE.centerpos.z}
                    for i=250,255 do
                        pp.stackpos = i
                        local p = getThingFromPos(pp)
                        if p.itemid ~= 0 then
                            doRemoveItem(p.uid,-1)
                            doSendMagicEffect(pp,15)
                        end
                    end
                end
            end
        end,
        check = function(pos)
            for i=1,10 do
                pos.stackpos = i
                local p = getThingFromPos(pos)
                if p.itemid == SNAKE.itemid then
                    return 1,p,true
                elseif not SNAKE.isWalkable(pos) then
                    return 3,p,false
                elseif p.itemid ~= 0 then
                    return 2,p
                end
            end
            return false
        end,
        find_and_delete = function(pos)
            for i=0,255 do
                pos.stackpos = 255-i
                local p = getThingFromPos(pos)
                if p.itemid == SNAKE.itemid then
                    return doRemoveItem(p.uid,1)
                end
            end
        end,
        isWalkable = function(pos, creature, proj, pz)-- by Nord
            if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
            if getTopCreature(pos).uid > 0 and creature then return false end
            if getTileInfo(pos).protection and pz then return false, true end
            local n = not proj and 3 or 2
            for i = 0, 255 do
                pos.stackpos = i
                local tile = getTileThingByPos(pos)
                if tile.itemid ~= 0 and not isCreature(tile.uid) then
                    if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                        return false
                    end
                end
            end
            return true
        end,
    }

     

    Alinha que está dando o erro é essa.

     

    if p1.x == p2.x and p1.y == p2.y then
  19. 9 minutos atrás, Caneelinha22 disse:

    Muito obrigado mano deu certin, outra duviva claro se vc poder responder, vc saberia como botar os dias de vip q falta, no meu so aparece "conta gratis" e "conta vip"

    Que bom que ajudei ^^ 

    Quandi estiver em casa eu respondo aqui.?

     

     

    so faltou meu rep+ ?

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...