Page 1 of 1

problems using require("filename.lua")

Posted: Tue Aug 13, 2013 5:11 am
by Nemesiz
--EDIT--
I have resolved my problem, instead of 'require("entities.lua")' it should have been 'require("entities")'
Sorry for wasting anyones time.
---------


so basically what i have is a directory with my main.lua and another .lua file. For instance lets say i have a doesntwork.lua.. (lol)... anywhoo

in my main.lua i have

Code: Select all

function love.load()
    require("doesntwork.lua")
end
with that i get the error: "module 'doesntwork.lua' not found: (then it lists the directories it searched in)"

Am I doing something wrong?

NOTE- I have the files in 'documents/luastuff/lovetest/'

Re: problems using require("filename.lua")

Posted: Tue Aug 13, 2013 4:10 pm
by raidho36
You don't pass file extension to require.

Code: Select all

local lib = require ( "mylib" )