problems using require("filename.lua")

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Nemesiz
Prole
Posts: 1
Joined: Tue Aug 13, 2013 4:54 am

problems using require("filename.lua")

Post 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/'
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

You don't pass file extension to require.

Code: Select all

local lib = require ( "mylib" )
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 2 guests