Peter_Aquino Posted January 12, 2023 Posted January 12, 2023 How can I created multiple switch at least four("4")
MC874 Posted January 12, 2023 Posted January 12, 2023 17 hours ago, Peter_Aquino said: How can I created multiple switch at least four("4") Hi @Peter_Aquino, what exactly "Switch" you're refering here? Is it some kind of switch statement? switch = { [1] = 'this is first', [2] = 'this is second', [3] = 'this is third', [4] = 'this is fourth' } choice = tonumber(gg.prompt({"Enter Choices"},{0},{"number"})[1]) if choice == nil then print('Invalid Choice, exitting..') os.exit() end # Example Use Case 1 print(switch[choice]) # Example Use Case 2 if switch[1] == 'this is first' then print('True') else print('False') end
Question
Peter_Aquino
How can I created multiple switch at least four("4")
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.