-1

我知道有人问过这个问题,但我找不到任何有帮助的东西,这是我的代码:

print("Welcome to Text RPG \n");
function commmand()
print("What do you want to do? \(\"help\" for help\) \n NOTE: MUST BE IN CAPS")
input = io.read()
--condition = input == "HELP" or input == "EAST" or input == "WEST" or input =="NORTH" or                     input == "SOUTH" or input == "SHOP"
     if input == "HELP" or input == "EAST" or input == "WEST" or input =="NORTH" or input==             "SOUTH" or input == "SHOP" then
      --Future game code
    end
    end
    command()

我尝试搜索但找不到答案,我什至注册了一个帐户只是为了问这个

4

1 回答 1

1
print("Welcome to Text RPG \n");
function command()
    print("What do you want to do? \(\"help\" for help\) \n NOTE: MUST BE IN CAPS")
    input = io.read()
    --condition = input == "HELP" or input == "EAST" or input == "WEST" or input =="NORTH" or input == "SOUTH" or input == "SHOP"
        if input == "HELP" or input == "EAST" or input == "WEST" or input =="NORTH" or input== "SOUTH" or input == "SHOP" then
            --Future game code
        end
end
command()

你需要改变:

function commmand()

function command()

注意删除的m.

于 2013-05-20T02:02:04.160 回答