• Super New Question
    6 replies, posted
So I have a file titled helloworld.lua, and inside this file we've got the following: [code]print( "Hello World!" )[/code] This file is placed inside garrysmod/garrysmod/lua. Next I run gmod, and type this in the console: [code]lua_openscript_cl helloworld.lua[/code] And nothing happens. Nothing also happens when I take off the _cl in lua_openscript_cl, and nothing also happens when I replace print with Msg(). I'm sure there's some obvious newbie mistake I'm making somewhere, but I just can't figure out what's wrong. Yeah, I'm pretty new at this. But this seems like the right forum for that. Thank you for any help.
The file's right, but the problem is where you're placing it. lua_openscript_cl only works on files in the [b]autorun[/b] folder, so if you place the file at garrysmod/garrysmod/lua/autorun, it should work fine. ERRR, apologies, just kidding. Senor Quebec is right.
[QUOTE=Entoros;18272476]The file's right, but the problem is where you're placing it. lua_openscript_cl only works on files in the [b]autorun[/b] folder, so if you place the file at garrysmod/garrysmod/lua/autorun, it should work fine.[/QUOTE] Thanks. :)
Actually I'm pretty sure that both lua_openscript and lua_openscript_cl can open scripts anywhere within the lua folder structure of Garry's Mod. I don't see what the problem is but it should not be that.
Damn. The thread title really got me. I guess adding "Super" to anything really pulls in attention.
[QUOTE=Crazy Quebec;18272584]Actually I'm pretty sure that both lua_openscript and lua_openscript_cl can open scripts anywhere within the lua folder structure of Garry's Mod. I don't see what the problem is but it should not be that.[/QUOTE] Well, I figured I'd say thanks to be polite. Because I added helloworld.lua to the autorun folder and it made no difference. The problem was fixed, however, after I went ingame. Before I was just trying to run the script right when I started gmod, because I'm following a tutorial that isn't exactly specific enough I suppose. [QUOTE=CptFuzzies;18272785]Damn. The thread title really got me. I guess adding "Super" to anything really pulls in attention.[/QUOTE] Achievement unlocked. *gesture of accomplishment*
Ah that's right. You have to be in a map for anything to happen. :smile: As for a tutorial I suggest you head to [url]http://wiki.garrysmod.com/?title=Lua[/url] where you can find the official lua documentation, garrysmod lua documentation and a pretty nice lua starter tutorial that you can find under Lua Tutorial Series.
Sorry, you need to Log In to post a reply to this thread.