I can't load .Lua-files from relative paths.
This works:
2.lua
function Math( v1, v2 )
return v1 + v2
end
1.lua
package.path = package.path .. ';C:/Users/Lukas/Desktop/lua/function/?.lua'
require("2")
print(Math(1,6))
This doesn't work:
package.path = package.path .. './function/?.lua;'
require("2")
print(Math(1,6))
Couldn't find any solution for my problem.
You're missing a ;
to separate the new path from the old one:
package.path = package.path .. ';./function/?.lua;'
require
probably showed you this message:
no file './2.lua./function/2.lua'
which should have alerted you to the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With