Jump to content
  • 0

Help me About gg.alert


theBeginner

Question

2 answers to this question

Recommended Posts

21 hours ago, theBeginner said:

local menu = gg.alert('Select Language','🇮🇩','🇬🇧')
if menu == 0 then
elseif menu == 1 then
elseif menu == 2 then Eng() end

function Indo()
gg.alert('Hai')
end

function Eng()
gg.alert('Hallo')
end

 

Where ia the wrong Om Beginner Sorry!! 

To use functions you need to use main menu() and todo action using button also. 

But , if you just want to give alert or if you don't want big codes without functions then you need like this,

 

local menu = gg.alert('Select Language','🇮🇩','🇬🇧')
if menu == nil then os.exit() end
if menu == 1 then gg.alert('Hai') end
if menu == 2 then gg.alert('Hallo')  end

 

But , if you have more codes not only alert and you need function then you need it like this,

 

gg.setVisible(false)
function Main()
local menu = gg.alert('Select Language','🇮🇩','🇬🇧','Exit')
if menu == nil then return 
else
if menu == 1 then Indo() end
if menu == 2 then Eng() end
if menu == 3 then exit () end
end
XGCK = -1
end

function Indo()
gg.alert('Hai')
end

function Eng()
gg.alert('Hallo')
end

function exit()
print('Bye')
os.exit()
end

while(true)do
if gg.isVisible(true) then
XGCK=1
gg.setVisible(false)
end
gg.clearResults()
if XGCK==1 then
Main()
end
end

Link to comment
Share on other sites

1 minute ago, AKRAMRAZA said:

To use functions you need to use main menu() and todo action using button also. 

But , if you just want to give alert then you need like this,

 

local menu = gg.alert('Select Language','🇮🇩','🇬🇧')
if menu == nil then os.exit() end
if menu == 1 then gg.alert('Hai') end
if menu == 2 then gg.alert('Hallo')  end

 

But , if you have more codes not only alert and you need function then you need it like this,

 

gg.setVisible(false)
function Main()
local menu = gg.alert('Select Language','🇮🇩','🇬🇧','Exit')
if menu == nil then return 
else
if menu == 1 then Indo() end
if menu == 2 then Eng() end
if menu == 3 then exit () end
end
XGCK = -1
end

function Indo()
gg.alert('Hai')
end

function Eng()
gg.alert('Hallo')
end

function exit()
print('Bye')
os.exit()
end

while(true)do
if gg.isVisible(true) then
XGCK=1
gg.setVisible(false)
end
gg.clearResults()
if XGCK==1 then
Main()
end
end

Thx U Very Much!! 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.