I do so:
- Code: Select all
require("script.lua")
require("..\Scripts\script.lua")
but it doesn't work.
require("script.lua")
require("..\Scripts\script.lua")
To determine its path, require first checks the global variable LUA_PATH. If the value of LUA_PATH is a string, that string is the path. Otherwise, require checks the environment variable LUA_PATH. Finally, if both checks fail, require uses a fixed path (typically "?;?.lua", although it is easy to change that when you compile Lua).
Users browsing this forum: No registered users and 3 guests