theBeginner Posted September 21, 2019 Share Posted September 21, 2019 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!! Link to comment Share on other sites More sharing options...
AKRAMRAZA Posted September 22, 2019 Share Posted September 22, 2019 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 More sharing options...
theBeginner Posted September 22, 2019 Author Share Posted September 22, 2019 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 More sharing options...
Question
theBeginner
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!!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.