Jump to content
  • 0

how to set multi function in one function


g1doz

Question

how to set multi function in one function

example

function fly_hack()
menu = gg.choice{"fly 1","fly 2","fly 3")","Back")
if not menu then home() end
if menu==1 then fly_1() end
if menu==2 then fly_2() end
if menu==3 then fly_3() end
if menu==6 then home() end
end

function fly_1()

end

function fly_2()

end

function fly_3()

end

i want to set this all function fly_hack and fly 1 2 3 in  one function how ?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

function fly_hack()
  table_menu = {"fly 1","fly 2","fly 3"}
  local menu = gg.choice(table_menu, 0,"Back")
  if not menu then home() end
  if menu==1 then fly_1() end
  if menu==2 then fly_2() end
  if menu==3 then fly_3() end
  if menu==6 then home() end
end

function fly_1()
  gg.alert(table_menu[1], "")
end

function fly_2()
  gg.alert(table_menu[2], "")
end

function fly_3()
  gg.alert(table_menu[3], "")
end

 

Link to comment
Share on other sites

function fly_hack()
local m = gg.choice{"fly 1","fly 2","fly 3","fly all"),nil,"Fly hack method")
if m==1 then fly_1() end
if m==2 then fly_2() end
if m==3 then fly_3() end

if m==4 then fly_1() fly_2() fly_3() end
if m==nil then home() end
end

function fly_1()

end

function fly_2()

end

function fly_3()

end

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.