John Smith Posted June 12, 2015 Share Posted June 12, 2015 hi, why is this happening? this is my part of code function onStop() fileDelete("ch/ch.reg"); fileDelete("ch/ch.sys"); local file1,file2 = fileCreate("ch/ch.reg"),fileCreate("ch/ch.sys"); local tab1,tab2 = toJSON(reg),toJSON(sys); fileWrite(file1,tab1): fileWrite(file2,tab2): fileClose(file1); fileClose(file2); end; addEventHandler("onResourceStop",resourceRoot,onStop); first file is properly written data to and closed but the other file is running into issues and everything in that function is defined so what does this error mean? how do i fix it? Link to comment
John Smith Posted June 12, 2015 Author Share Posted June 12, 2015 can anyone help me.. please? c: Link to comment
Olle Risk Posted June 12, 2015 Share Posted June 12, 2015 Lua won't enforce ; (semicolon) at the end of each line like other languages, and in your file you have : (regular colon) after the two write lines, at that runs upon resource stop you won't notice that the script crashes and stops running directly after the first file is written. Remove all the ; and : at the end of the lines and try it, that should work. Link to comment
John Smith Posted June 12, 2015 Author Share Posted June 12, 2015 haha lmao i didn't notice that it was : instead of ; (my notepad++ font makes : and ; look almost the same so didn't see it) , thanks and yes semicolon cant be at each of every line but it can be after function calls,ends, and variables and in tables Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now