--メニュー画面
runnning = true
print("---tomato---")
print("トマトがここにあるよ")
print("どうしよう?")
print("1: 眺める")
print("2: 嗅ぐ")
print("3: 食べる")
print("----------------")
--入力の読み込み
local input = io.read()
local choice = tonumber(input)
local endings = {
    [0] = "programis end error\nENDprogram/",
    [1] = "トマトを眺めた新鮮で美味しそう\nトマトが爆発した!\nEND1/トマトが爆発するのは常識だよね?",
    [2] = "トマトを嗅いだ\nあまりにも匂いがキツすぎた\nEND2/手で仰いで嗅ごうって理科で習わなかった?",
    [3] = "勝手に食べちゃだめだと思う\nえ〜?どうしても?\nじゃあしょうがない\nドゴオオオオオン\nEND3/ト マ ト は 食 べ る と 地 球 が 滅 び ま す",
    [3647198] = "え?なんでこの数字わかったの?\nこれ適当に打ったんだけど\nえ?まじで?\nうっわーまじかー\nよくないわー\nEND?/スクリプト見たでしょ?"
}
--入力された文字への反応
if endings[choice] then
    print(endings[choice])
elseif choice == 0 then
        -- 0が選ばれたらループを終わらせる
        running = false 
    elseif endings[choice] then
        print(endings[choice])
    else
        print("そんな番号はないよ?")
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: