Lua file corrupt?

I cant figure out what has gone wrong.

In an attempt to better organize my lua files I had changed the name of the file from firstLevel.lua to firstLevel8.lua

I use the following code to change scenes of my levels

local function switchScene(event) if introEnd == true then composer.removeScene("Scripts.titleScreen") composer.gotoScene( "Scripts.firstLevel8", {effect = "fade", time = 1000} ) end end

the problem is that when I made the change I now get this error

Error loading module ‘Scripts.firstLevel8’ from file ‘/Users/ethandunlap/Desktop/Lost in the Forest/Scripts/firstLevel8.lua’:

/Users/ethandunlap/Desktop/Lost in the Forest/Scripts/firstLevel8.lua:57: unexpected symbol near ‘local’

File: error loading module ‘Scripts.firstLevel8’ from file ‘Scripts/firstLevel8.lua’

I cant seem to figure out what is going on. To make things worse, I have changed the name back to the original name and it still does not work

“unexpected symbol near ‘local’” means you’re failing to start a function declaration or finish one properly. I doubt it’s anything to do with the file renaming - if it were, changing the name back would fix it.

Can you post the whole file so we can see?

First off, go through it line by line making sure you’ve started and completed each function correctly, and not missing any ‘end’ statements from functions or if blocks, etc.

“unexpected symbol near ‘local’” means you’re failing to start a function declaration or finish one properly. I doubt it’s anything to do with the file renaming - if it were, changing the name back would fix it.

Can you post the whole file so we can see?

First off, go through it line by line making sure you’ve started and completed each function correctly, and not missing any ‘end’ statements from functions or if blocks, etc.