The problem is that you are using dofiles in files that have been dofiled without fully understanding what happens. In short don't use dofiles unless you are 100% sure you know what it does.
To run through what it does, go through this little exercise (on a copy of the project). Start at the first script that is called. Everytime you hit a dofile call, copy the contents of the file that you are dofiling and replace the dofile call with it. eg
becomesif 10 == X then
dofile("haha.lua")
end
Then start again from the top of the file. Keep going until there are no more dofile calls and post the code here again. You should end up with one script. If you don't, you are using dofiles incorrectly.if 10 == X then
-- what was in haha.lua
X = 40
end
Bookmarks