[SOLVED] Module loading error...

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
RBXcpmoderator12345
Citizen
Posts: 59
Joined: Sat Mar 07, 2015 11:53 pm

[SOLVED] Module loading error...

Post by RBXcpmoderator12345 »

I'm trying to make a FNaF type game, and I decided to put the characters' code in seperate .lua files.
I was making the first one, but i got a error trying to load it.
ser.lua is the serialization library
cron.lua is for timing
1.lua is one of the characters' code
.love = https://www.mediafire.com/?2gcjliirjw8evzd
Last edited by RBXcpmoderator12345 on Sat Apr 18, 2015 11:37 pm, edited 1 time in total.
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: Module loading error...

Post by I~=Spam »

You write:

Code: Select all

require "cron.lua"
but it should be:

Code: Select all

require "cron"
Lua in later versions automatically adds the ".lua" when using the require function

Also I noticed that you don't return anything in 1.lua If you don't add a "return somthing" at the end of the file then anim1 will only get a bool with a value of true (the true means that the file was successfully loaded).
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests