Lua Require function on a full path name

后端 未结 2 384
天命终不由人
天命终不由人 2021-01-11 13:08

I need to call the require on a lua file that will not always be in the same place. I was trying to call require on the full path name but that doesn\'t seem to be working e

2条回答
  •  粉色の甜心
    2021-01-11 13:35

    If you just need to load a file, use dofile, which takes a path:

    dofile("C:\\Users\\Me\\MyLuaProject\\foo")
    

提交回复
热议问题