• Can you include lua in a map file?
    11 replies, posted
I want my map to be able to do somethings that require a small lua file. Is it possible to include a lua file in a map with packrat or in some other way?
You could with pakrat, or you could use the lua_run entity (garrysmod.fgd required). Note that lua files will only be ran in garrysmod.
Is it possible to bundle SNPCs/SWEPs into a map? Like, if set it run on map load via lua_run, will SNPCs and SWEPS show up in the map? I remember that older iterations of Gmod had an SWEP entity though.
[QUOTE=Kuro.;39526432]Is it possible to bundle SNPCs/SWEPs into a map? Like, if set it run on map load via lua_run, will SNPCs and SWEPS show up in the map? I remember that older iterations of Gmod had an SWEP entity though.[/QUOTE] I'm pretty sure you can just pakrat the same filesystem as sweps/snpc and it will work fine. I've never done it though so I can't be 100%.
You can pakrat it but I don't think it'll work. I tried something like that months ago; nothing was wrong with the code but it wouldn't run. I'm not sure how lua works in GMod but my guess is it won't initialize or the server doesn't recognize it or etc.
[QUOTE=HighdefGE;39529917]You can pakrat it but I don't think it'll work. I tried something like that months ago; nothing was wrong with the code but it wouldn't run. I'm not sure how lua works in GMod but my guess is it won't initialize or the server doesn't recognize it or etc.[/QUOTE] The lua can operate clientside only afaik, I think spacew00t noticed this way back in GMod9 when he made VGUI panels for his resourcing and room lights and stuff.
[QUOTE=Ereunity;39532270]The lua can operate clientside only afaik, I think spacew00t noticed this way back in GMod9 when he made VGUI panels for his resourcing and room lights and stuff.[/QUOTE] But doesn't gm_mobinex use serverside lua?
[QUOTE=vexx21322;39532552]But doesn't gm_mobinex use serverside lua?[/QUOTE] I will do some testing with packrat and report back.
Garry blocked Lua scripts from being run from within maps years ago due to exploits and Lua based viruses. I know in Gm12 it wasn't possible, but I'm not sure if he lifted the restriction on GM13 or not.
Probably not unless he seriously revamped what scripts are allowed to access/do.
[QUOTE=bohb;39547789]Garry blocked Lua scripts from being run from within maps years ago due to exploits and Lua based viruses. I know in Gm12 it wasn't possible, but I'm not sure if he lifted the restriction on GM13 or not.[/QUOTE] But you're wrong.
[QUOTE=Map in a box;39557650]But you're wrong.[/QUOTE] Prove it then.
Sorry, you need to Log In to post a reply to this thread.