lua: TextRPG.lua:15: 尝试调用全局变量 'command'(其值为 nil)

我知道这个问题已经被问过了,但我找不到任何有用的东西,下面是我的代码:

print(“欢迎来到文字 RPG \ n”);
function commmand()
print(“您想做什么?\(\"需要帮助\"以获得帮助\)\n 注意:必须大写”)
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()

我试着搜索但找不到答案,甚至注册了一个帐号来询问这个问题。

点赞
用户2303714
用户2303714
print("欢迎来到 Text RPG \n");
function command()
    print("你想要做什么? \(输入\"help\"获取帮助\) \n 注意:必须大写输入")
    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
            --未来的游戏代码
        end
end
command()
2013-05-20 02:02:04