Jump to content

Tutoriais de Scripting

Aprenda a fazer seus próprios scripts e desenvolva seu OT.


666 topics in this forum

    • 11 replies
    • 2.5k views
    • 1 reaction

    • 3 replies
    • 2.7k views
    • 23 replies
    • 21.9k views
    • 32 replies
    • 6.6k views
    • 1 reply
    • 961 views
    • 0 replies
    • 798 views
    • 0 replies
    • 944 views
    • 22 replies
    • 6.2k views
    • 1 reply
    • 3.7k views
    • 0 replies
    • 1.4k views
  1. Como usar addEvent

    • 5 replies
    • 3.6k views
  2. Ppoints tfs 1.0+

    • 3 replies
    • 1.7k views
    • 1 reply
    • 1.4k views
    • 25 replies
    • 7k views
    • 4 replies
    • 1k views
    • 1 reaction

    • 0 replies
    • 2k views
    • 2 reactions

    • 7 replies
    • 5.8k views
    • 7 replies
    • 3.1k views
    • 4 replies
    • 1.5k views
    • 6 replies
    • 1.7k views
  3. Outfits

    • 10 replies
    • 6.1k views
  4. Criando Escadas Novas

    • 1 reply
    • 1.2k views
    • 18 replies
    • 6k views
  5. Ranking diferente in-game

    • 3 replies
    • 1.1k views
    • 3 replies
    • 1.9k views
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Popular Contributors

  • Topics

  • Últimos Posts

    • local regenEvent = {} -- Tabela para armazenar os identificadores de eventos por jogador. function onEquip(cid, item, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Activated Strength Blessing.") doSendAnimatedText(getPlayerPosition(cid), "Reloading!!", 210) doPlayerSay(cid, "POWER-UP!", 16) doSendMagicEffect(getPlayerPosition(cid), 95) local function regenVida() if isPlayer(cid) then doPlayerAddHealth(cid, 1000) -- Adiciona vida ao jogador. regenEvent[cid] = addEvent(regenVida, 1 * 1000) -- Reagendar o evento. end end regenEvent[cid] = addEvent(regenVida, 1 * 1000) -- Inicializa o evento. return TRUE end function onDeEquip(cid, item, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Strength Blessing Disabled.") doSendAnimatedText(getPlayerPosition(cid), "Weakening!!", 210) doPlayerSay(cid, "Losing Strength!", 16) doSendMagicEffect(getPlayerPosition(cid), 95) -- Parar o evento associado ao jogador. if regenEvent[cid] then stopEvent(regenEvent[cid]) -- Cancela o evento em execução. regenEvent[cid] = nil -- Remove o identificador para evitar uso futuro. end return TRUE end  
    • Estou com esse script q to criando, a função já está pegando certinho, porem não para de funfar kkk o stopevent não ta funcionando alguem me ajuda?     function onEquip(cid, item, position, fromPosition)     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Activated Strength Blessing.")     doSendAnimatedText(getPlayerPosition(cid), "Reloading!!", 210)     doPlayerSay(cid, "POWER-UP!", 16)     doSendMagicEffect(getPlayerPosition(cid), 95)         local function regenVida(cid)       doPlayerAddHealth(cid, 1000)       addEvent(regenVida, 1 * 1000, cid)     end     regenVida(cid)         return TRUE   end     function onDeEquip(cid, item, position, fromPosition)     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Strength Blessing Disabled.")     doSendAnimatedText(getPlayerPosition(cid), "Weakening!!", 210)     doPlayerSay(cid, "Losing Strength!", 16)     doSendMagicEffect(getPlayerPosition(cid), 95)         local function regenVida(cid)     stopEvent(regenVida) end   return TRUE   end       se estiver no local errado por favor mover.
    • [URL=https://casualmatch.site]Explore Exciting Connections for One-Night Fun in Your Town[/URL] [URL=https://pills.casualmatch.site] Pharmacy, wholesale prices, shipping to any location.[/URL]
    • 1.Adicione um comando para escolher o Pokémon: Digamos que você adicione !choosepokemon para configurar o Pokémon que o jogador deseja derrotar. 2.Adapte a função resetDailyKill para usar essa escolha:   function choosePokemon(cid, pokemonName) if isPlayer(cid) then local mode = killModes[(getCatchMode(cid))] local pokemons = mode.pokemons if table.contains(pokemons, pokemonName) then local count = math.random(getPlayerLevel(cid) * 2) local day = tostring(""..getNumberDay().."-"..getNumberMonth().."-"..getNumberYear().."") setPlayerStorageValue(cid, killModes.storage, "|"..getCatchMode(cid).."|"..day.."|"..pokemonName.."|false|"..count) setPlayerStorageValue(cid, killModes.storage2, -1) setPlayerStorageValue(cid, 24003, 0) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have chosen: " .. pokemonName .. " as your daily kill target.") else doPlayerSendCancel(cid, "Invalid Pokémon. Choose from the list.") end end end 3.Implementar comando para escolha:   function onSay(cid, words, param) if param == "" then doPlayerSendCancel(cid, "Use: !choosepokemon <pokemon_name>") return true end choosePokemon(cid, param:trim()) return true end  
    • Para o comando !sell:   function onSay(cid, words, param) local config = { levelNeeded = 8, muteTime = 120, -- tempo em segundos storage = 7896 } if param == "" then doPlayerPopupFYI(cid, "Use: !sell itemName, price in GP") return true end local t = string.explode(param, ",") if not(t[1]) or not(t[2]) then doPlayerSendCancel(cid, "Command requires more than one parameter.") return true end if getPlayerLevel(cid) >= config.levelNeeded then if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()) elseif getPlayerStorageValue(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "You can only place one offer in " .. config.muteTime .. " seconds.") return true else local itemName = t[1]:trim() local price = tonumber(t[2]) if price <= 0 then doPlayerSendCancel(cid, "Invalid price.") return true end local itemId = getItemIdByName(itemName) if getPlayerItemCount(cid, itemId) > 0 then doBroadcastMessage("Player " .. getPlayerName(cid) .. " is selling " .. itemName .. " for " .. price .. " gold coins.") setPlayerStorageValue(cid, config.storage, (os.time() + config.muteTime)) else doPlayerSendCancel(cid, "You don't have the item '" .. itemName .. "' to sell.") end end else doPlayerSendCancel(cid, "Only players with level " .. config.levelNeeded .. " can broadcast an offer.") end return true end Para o comando !buy:   function onSay(cid, words, param) local config = { levelNeeded = 8, muteTime = 120, storage = 7896 } if param == "" then doPlayerPopupFYI(cid, "Use: !buy itemName, price in GP") return true end local t = string.explode(param, ",") if not(t[1]) or not(t[2]) then doPlayerSendCancel(cid, "Command requires more than one parameter.") return true end if getPlayerLevel(cid) >= config.levelNeeded then if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()) elseif getPlayerStorageValue(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "You can only place one offer in " .. config.muteTime .. " seconds.") return true else local itemName = t[1]:trim() local price = tonumber(t[2]) if price <= 0 then doPlayerSendCancel(cid, "Invalid price.") return true end -- Logica de compra do item: verificar se algum jogador está vendendo o item -- e o preço condiz com a oferta. Se sim, retirar o item do vendedor e -- transferir para o comprador doBroadcastMessage("Player " .. getPlayerName(cid) .. " is buying " .. itemName .. " for " .. price .. " gold coins.") setPlayerStorageValue(cid, config.storage, (os.time() + config.muteTime)) end else doPlayerSendCancel(cid, "Only players with level " .. config.levelNeeded .. " can broadcast an offer.") end return true end  
×
×
  • Create New...