Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. Scripts
  3. Turning off a module by using 5-secs delay after turning it on?

Turning off a module by using 5-secs delay after turning it on?

Scheduled Pinned Locked Moved Scripts
5 Posts 4 Posters 313 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dntdbtD Offline
    dntdbtD Offline
    dntdbt
    wrote on last edited by
    #1

    Hey, how to make a module which automatically turns off after 5 seconds after turning it on
    That's the thing I need

    CzechHekC 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Use a tick variable for it. On enable, set tick to 0, and on update set tick++. Check if tick == 100 (cuz 1 sec = 20 ticks which means 5 sec = 100 ticks) then toggle it

      yorik100Y 1 Reply Last reply
      0
      • CzechHekC Offline
        CzechHekC Offline
        CzechHek
        replied to dntdbt on last edited by
        #3

        @dont_doubt

        ///api_version=2
        (script = registerScript({
            name: "TurnItOff",
            authors: ["CzechHek"],
            version: "1.0"
        })).import("Core.lib");
        
        module = {
            onEnable: function () {
                timeout(5000, function () TurnItOffModule.state = false);
            }
        }
        
        1 Reply Last reply
        0
        • yorik100Y Offline
          yorik100Y Offline
          yorik100
          replied to A Former User on last edited by
          #4

          @sexma said in Turning off a module by using 5-secs delay after turning it on?:

          Use a tick variable for it. On enable, set tick to 0, and on update set tick++. Check if tick == 100 (cuz 1 sec = 20 ticks which means 5 sec = 100 ticks) then toggle it

          e6caf188-5111-4817-8d45-b6666395c6c5-image.png

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            That's the easiest way to do it. You can do it without much javascript knowledge

            1 Reply Last reply
            0

            About
            • Terms of Service
            • Privacy Policy
            • Status
            • Contact Us
            Downloads
            • Releases
            • Source code
            • License
            Docs
            • Tutorials
            • CustomHUD
            • AutoSettings
            • ScriptAPI
            Community
            • Forum
            • Guilded
            • YouTube
            • Twitter
            • D.Tube
            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups