--プレイヤーのお金のショップアイテムの定義
local player = {
    money = 5000
}
local s = {
    {name = "tomato`s friend(nomaltomato)", price = 1000},
    {name = "medkit(toamtos inside)", price = 500},
    {name = "juice(made from a tomato)", price = 120},
    {name = "seed(tomato)", price = 80}
}
--ショップ画面の出力
print("---tomato`s fun shop!!!!!!---")
print("--------------------------------")
print("tomato: What are you going 2 buy?")
print("your wolet: " .. player.money .. " tomato")
print("1: " .. s[1].name .. "price: " .. s[1].price .. "tomato")
print("2: " .. s[2].name .. "price: " .. s[2].price .. "tomato")
print("3: " .. s[3].name .. "price: " .. s[3].price .. "tomato")
print("4: " .. s[4].name .. "price: " .. s[4].price .. "tomato")
print("--------------------------------")
--入力されたものを読み取る
local input = io.read()
local choice = tonumber(input)
--購入した時のスクリプト
if choice == 1 then
    print("you buy " .. s[1].name .. "!")
    print("tomato: thenkU 4 buying!")
    print("tomato: take good care of my friend.")
    print("your money remain: " .. player.money - s[choice].price)
elseif choice == 2 then
    print("you buy " .. s[2].name .. "!")
    print("tomato: thenkU 4 buying!")
    print("tomato: Check the tomatoes inside every now and then.")
    print("your money remain: " .. player.money - s[choice].price)
elseif choice == 3 then
    print("you buy " .. s[3].name .. "!")
    print("tomato: thenkU 4 buying!")
    print("tomato: Drink this in honor of your friend who was cut to pieces")
    print("your money remain: " .. player.money - s[choice].price)
elseif choice == 4 then
    print("you buy " .. s[4].name .. "!")
    print("tomato: thenkU 4 buying")
    print("tomato: Please take good care of this part of our bodies")
    print("your money remain: " .. player.money - s[choice].price)
end

Embed on website

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