Jump to content
star360

How to Create On/Off Button With Saved List

Recommended Posts

Create on/off button in lua script

 No need to searching values for every time

 Simple script but better ideas

Read this simple script carefully

You will be understand 

 

 Specially thanks to @MuhammadRizwan87

Credit @TDOhex

 

function search()
  gg.clearResults()
  gg.setRanges(gg.REGION_C_DATA)
  gg.searchNumber("1;2;3", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
  gg.refineNumber("1", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
  local t = gg.getResults(3)
  for i, v in ipairs(t) do
    t[i].name = 'testoff'
  end
  gg.addListItems(t)
  gg.clearResults(t)
end
search()

 

on = "[OFF]"
off = "[ON]"
test = off

 

function main()
  menu = gg.choice({
    test.."  Test",
    "Exit"}, nil, "Example by @TDOhex")

 

  if menu == 1 then
    if test == off then
      test = on
      local t = gg.getListItems(testoff)
      for i, v in ipairs(t) do
        if v.name == "testoff" then
          t[i].value = 0
          t[i].name = 'teston'
        end
        gg.setValues(t)
        gg.addListItems(t)
      end
    else
      test = off
      local t = gg.getListItems(teston)
      for i, v in ipairs(t) do
        if v.name == "teston" then
          t[i].value = 1
          t[i].name = 'testoff'
        end
        gg.setValues(t)
        gg.addListItems(t)
      end
    end

 

  elseif menu == 2 then
    print("Thanks to visiting @TDOhex")
    gg.copyText('https://t.me/TDOhex')
    intro = "Join to @TDOhex"
    for i = 1, #intro do
      gg.toast(intro:sub(1, i) .. "_✍")
      gg.sleep(140)
    end
    local t = gg.getListItems()
    gg.removeListItems(t)
    os.exit()
  end
end

 

while true do
  if gg.isVisible() then
    gg.setVisible(false)
    main()
  end
end

 

I just shared it... 

On-Off_Example.lua

Share this post


Link to post
Share on other sites


  • Similar Content

    • By argarrize
      View File Script : Among Us
      Hi Everyone, 
      Enjoy The Script !
       
      All descriptions of its features are in the script
      Feature :
      - No clip
      - Giant Size
      - Vision Hack
      Support ON/OFF : Yes
      *Sorry typo at my nick name lol haha
      Submitter argarrize Submitted 09/12/2020 Category LUA scripts  
    • By Yanik
      View File Among us script
      Hello, i create among us script. 
      Creator Public_Scripts Rama Production. 
       
      Among us its MY script. 
      Functions:
      SpeedHack
      Wallhack
      SuperEyes
      AlwaysImpostor
      Revive
      And more
      Submitter Yanik Submitted 09/23/2020 Category LUA scripts  
    • By Yanik
      Hello, i create among us script. 
      Creator Public_Scripts Rama Production. 
       
      Among us its MY script. 
      Functions:
      SpeedHack
      Wallhack
      SuperEyes
      AlwaysImpostor
      Revive
      And more
    • By Brilliant_Azure
      View File PUBG MOBILE 1.0.0 ANTIBAN SAFE VIP SCRIPT
       ⭕ PUBG MOBILE 1.0.0 SAFE SCRIPT ⭕
       FEATURES OF SCRIPT
      ☑️. ALL NEW & UPDATED  CODES FOR 1.0.0 PUBG UPDATE
      ☑️.SUPPORT ALL TYPE OF PROCESSORS
      ☑️.SUPPORT BOTH ROOTED AND NON-ROOTED DEVICES
      ☑️.ALL CODES ARE 100% CHECKED AND  SAFE
      ☑️.SIMPLE UI AND NO PASSWORD
      ♻️ FOR MORE FREE & WORKING PUBG HACKS JOIN 
       
      Submitter Brilliant_Azure Submitted 10/29/2019 Category PUBG  
    • By Brilliant_Azure
      ⭕ PUBG MOBILE 1.0.0 SAFE SCRIPT ⭕
       FEATURES OF SCRIPT
      ☑️. ALL NEW & UPDATED  CODES FOR 1.0.0 PUBG UPDATE
      ☑️.SUPPORT ALL TYPE OF PROCESSORS
      ☑️.SUPPORT BOTH ROOTED AND NON-ROOTED DEVICES
      ☑️.ALL CODES ARE 100% CHECKED AND  SAFE
      ☑️.SIMPLE UI AND NO PASSWORD
      ♻️ FOR MORE FREE & WORKING PUBG HACKS JOIN 
       
×
×
  • Create New...