892 posts
Location
Where you'd least expect it.
Posted 14 May 2013 - 09:58 PM
When ever I try this code, it always errors with startup: 95: bad argument #1: value expected. It is weird, because I try/define everything and then when it gets to this pcall statement, it errors on me.
Installer (Beta)
pastebin get
2LVGRcKi install
PS: Debug prints is what I use to debug, don't hate me! XD
Edit: Oh ya, the code.
https://github.com/M...ob/beta/startup
695 posts
Location
In my basement.
Posted 15 May 2013 - 01:41 AM
I think you didn't declare the "func" function.
1548 posts
Location
That dark shadow under your bed...
Posted 15 May 2013 - 03:01 AM
I think you didn't declare the "func" function.
loadstring returns a function, setfenv returns the function it edited (in this case the loadstring return). I think the issue is that the loadstring is returning nil. Please check that the http.get function is getting the right information and if you loadstring it make sure it returns a function
892 posts
Location
Where you'd least expect it.
Posted 15 May 2013 - 09:44 AM
I print the type of the func function, it prints function.
And even if you put pcall(lolololololrotortlotlrtlorto) in the LUA prompt it doesn't say that, only when you put pcall().
Edit: Nevermind, fixed the problem.
1548 posts
Location
That dark shadow under your bed...
Posted 15 May 2013 - 10:38 AM
what was the problem? I be curious
892 posts
Location
Where you'd least expect it.
Posted 15 May 2013 - 06:53 PM
Apparently, in loadfile, if the file has a syntax error, it returns a function with no value? I don't think it actually works that way, or .OSRunner/Boot/startup had a weird problem on line 95. (But when I changed the line on the regular /startup, it also changed the line in the error to the line with that same code.)
I think that it was just a mistake on my part.
1548 posts
Location
That dark shadow under your bed...
Posted 15 May 2013 - 07:56 PM
heh. I just realized that it was not pcall that was causing that issue… it was setfenv lol, loadstring returned nil which caused setfenv to error before pcall even ran