Ir para conteúdo

Programação

Seção destinada para dúvidas e erros relacionados a programação.


Explore Perguntas

Não há nenhuma pergunta popular de mostrar agora

575 questões neste fórum

  1. [Regras] Programação Otserv

    0 votos
    0 respostas
  2. Bug bag 6 pokemons

    0 votos
    37 respostas
  3. tfs

    0 votos
    22 respostas
  4. 0 votos
    21 respostas
  5. Duvida source

    0 votos
    20 respostas
  6. Erro ao compilar tfs 0.3.6

    0 votos
    19 respostas
  7. Compilar Psoul ??

    0 votos
    18 respostas
  8. {Ajuda} Adaptar código para TFS 0.4

    0 votos
    17 respostas
  9. Ajuda a compilar Source

    0 votos
    16 respostas
  10. Distro não abre.

    0 votos
    15 respostas
  11. {Help} Arrumar script!

    0 votos
    15 respostas
  12. Erro compilação

    0 votos
    15 respostas
  13. 0 votos
    15 respostas
  14. Bug Fly

    0 votos
    14 respostas
  15. Bug Armor e Legs

    0 votos
    13 respostas
  16. 0 votos
    13 respostas
  17. Erro OnLogin..

    0 votos
    13 respostas
  18. Operador Ternário em lua

    0 votos
    12 respostas
  19. 0 votos
    11 respostas
  20. Catch Pokemon e Level Pokemon

    0 votos
    11 respostas
  21. 0 votos
    11 respostas
  22. 0 votos
    10 respostas
  23. Adaptação para 0.4 e Correção de Bug!

    0 votos
    10 respostas
  24. 0 votos
    10 respostas
  25. 0 votos
    10 respostas
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
  • Mais Reputados

  • Tópicos

  • Últimos Posts

    • function onUse(cid, item, fromPosition, itemEx, toPosition) local petName = "[PET] NIVEL MAXIMO" local requiredStorage1 = 91811 local requiredStorage2 = 13546 local storageValue = 83712 local playerPets = getCreatureSummons(cid) -- Check if the player has the required immortality storages if getPlayerStorageValue(cid, requiredStorage1) == 1 and getPlayerStorageValue(cid, requiredStorage2) == 1 then -- Check if the player already has a summoned pet if #playerPets <= 0 then -- If no pet is summoned, summon a new one local newPet = doSummonMonster(cid, petName) if newPet then setPlayerStorageValue(cid, storageValue, 1) end else -- If a pet is summoned, check if it's the correct one and remove it for _, pet in ipairs(playerPets) do if getCreatureName(pet) == petName then doRemoveCreature(pet) end end end else -- If the player doesn't have the required storages, send a message doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need the immortality storage to use this item.") end return true end  
    • FL Studio Mobile brings the power of professional music production straight to your mobile device. With a user-friendly interface and a comprehensive suite of features, FL Studio Mobile empowers musicians, producers, and DJs to create, edit, and mix music on the go. Whether you're composing beats, recording vocals, or arranging tracks, FL Studio Mobile offers a seamless and intuitive experience for music creation anytime, anywhere.    
    • -=[TFS]=- 0.3.6 8.60 - PET HIT COM MAGIA NO PLAYER QUE O SUMONO OU SEJA NO DOMADOR ELE ATACA A CRITATURA PLAYER OU MONSTER MAIS MAGIA EM AREA AFETA O DOMADOR   Item que sumona pet <action itemid="4864" event="script" value="simple_pet.lua"/>   SCRIPT QUE USO ESTA FALTANDO PRA O PET NÃO ATACA COM MAGIA NO DOMADOR OU SEJA QUEM SUMONO O PET   function onUse(cid, item, fromPosition, itemEx, toPosition) local petName = "[PET] NIVEL MAXIMO" local storageValue = 83712 local playerPets = getCreatureSummons(cid) -- Verifica se o jogador já tem um pet invocado if #playerPets <= 0 then -- Se não houver pet invocado, invoca um novo local newPet = doSummonMonster(cid, petName) if newPet then setPlayerStorageValue(cid, storageValue, 1) end else -- Se houver pet invocado, verifica se é o pet correto e remove-o for _, pet in ipairs(playerPets) do if getCreatureName(pet) == petName then doRemoveCreature(pet) end end end return true end     <?xml version="1.0" encoding="UTF-8"?> <monster name="[PET] NIVEL MAXIMO" nameDescription="[PET] NIVEL MAXIMO" race="fire" experience="" speed="999" manacost="0"> <health now="950000000" max="950000000"/> <look type="35" corpse="3058"/> <targetchange interval="" chance="1000000000"/> <strategy attack="1000000000" defense="1000000000"/> <flags> <flag skull="4"/> <flag summonable="0"/> <flag attackable="0"/> <flag hostile="0"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="0"/> <flag canpushcreatures="0"/> <flag targetdistance="0"/> <flag staticattack="0"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="" min="-9584571530" max="-95845715300"/> <attack name="firecondition" interval="1000" chance="1000000" range="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="yellowspark"/> </attack> <attack name="death" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="mortarea"/> </attack> <attack name="speed" interval="1000" chance="1000000" radius="100" target="100" speedchange="-1000000" duration="100000"> <attribute key="areaEffect" value="poison"/> </attack> <attack name="strength" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="blackspark"/> </attack> <attack name="firefield" interval="1000" chance="1000000" radius="100" target="100"> <attribute key="areaEffect" value="explosion"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="explosion"/> <attribute key="areaEffect" value="YELLOWENERGY"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="ENERGYBALL"/> <attribute key="areaEffect" value="assassin"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="ICE"/> <attribute key="areaEffect" value="WATERCREATURE"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="fire" interval="" chance="1000000" range="100" radius="100" target="1" min="-1000000000" max="-1000000000"> <attribute key="shootEffect" value="DEATH"/> <attribute key="areaEffect" value="EXPLOSION"/> </attack> <attack name="manadrain" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="energyarea"/> </attack> <attack name="energy" interval="1000" chance="1000000" length="100" spread="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="poisoncondition" interval="1000" chance="1000000" length="100" spread="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="greenspark"/> </attack> <attack name="lifedrain" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="greenshimmer"/> </attack> <attack name="death" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="mortarea"/> </attack> <attack name="speed" interval="1000" chance="1000000" radius="100" target="100" speedchange="-1000000" duration="100000"> <attribute key="areaEffect" value="poison"/> </attack> <attack name="strength" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="blackspark"/> </attack> <attack name="firefield" interval="1000" chance="1000000" radius="100" target="100"> <attribute key="areaEffect" value="explosion"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="fire" interval="1000" chance="1000000" range="100" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="fire" interval="" chance="1000000" range="100" radius="100" target="1" min="-1000000000" max="-1000000000"> <attribute key="shootEffect" value="HOLY"/> <attribute key="areaEffect" value="EXPLOSION"/> </attack> <attack name="manadrain" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="energyarea"/> </attack> <attack name="energy" interval="1000" chance="1000000" length="100" spread="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="poisoncondition" interval="1000" chance="1000000" length="100" spread="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="greenspark"/> </attack> <attack name="lifedrain" interval="1000" chance="1000000" radius="100" target="100" min="-1000000" max="-1000000"> <attribute key="areaEffect" value="greenshimmer"/> </attack> <attack name="fire" interval="" chance="1000000" range="100" radius="100" target="100" min="-150" max="-250"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="fire" interval="" chance="1000000" range="100" radius="100" target="1" min="-1000000000" max="-1000000000"> <attribute key="shootEffect" value="HOLY"/> <attribute key="areaEffect" value="EXPLOSION"/> </attack> <attack name="manadrain" interval="" chance="1000000" radius="100" target="100" min="-1000000000" max="-10000000000"> <attribute key="areaEffect" value="energyarea"/> </attack> <attack name="lifedrain" interval="" chance="1000000" radius="100" target="100" min="-1000000000" max="-10000000000"> <attribute key="areaEffect" value="greenshimmer"/> </attack> </attacks> <defenses armor="999" defense="999"> <defense name="healing" interval="100" chance="100000" min="950000000" max="950000000"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="2000" chance="100000" speedchange="900" duration="9000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> <immunities> <immunity physical="100"/> <immunity energy="100"/> <immunity fire="100"/> <immunity poison="100"/> <immunity lifedrain="100"/> <immunity paralyze="100"/> <immunity outfit="100"/> <immunity drunk="100"/> <immunity invisible="100"/> <immunity ice="100"/> <immunity death="100"/> <immunity holy="100"/> </immunities> <voices interval="1000" chance="1000000"> <voice sentence="INVENCIVEL!" yell="1"/> </voices> <loot> <item id="1988" chance="1000000"> <inside> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> <item id="2159" countmax="1000000" chance1="1000000000" chancemax="1000000000"/> </inside> </item> </loot> </monster>  
    • acho que isso resolve:   function onLogin(player) local spawnPosition = Position(100, 50, 7) -- Coordenadas do spawn local occupied = false -- Verifica se existe algum jogador na posição de spawn for _, otherPlayer in ipairs(Game.getPlayers()) do if otherPlayer:getPosition() == spawnPosition then occupied = true break end end -- Se a posição de spawn estiver ocupada, move o jogador para uma posição próxima if occupied then local newPosition = spawnPosition:getRandomTile(1) -- obtém uma posição aleatória adjacente player:teleportTo(newPosition) else player:teleportTo(spawnPosition) end end -- Registra o evento de login para chamar a função onLogin function onLoginEvent(player) onLogin(player) end  
×
×
  • Criar Novo...