LUA files referenced in a map

okay, I’m learning LUA only for GMod, and certain things i could only figure out how to do in multi-line configs, so it has to be a file, and can’t be phrased into an LUA_run entity.

So how can i run an LUA file either server- or client-side?
I’ve tried using concommand, but Lua_run, lua_run_cl, and lua_openscript are all blacklisted, garry disabled both point_whatever_commands, and I’m all out of ideas.

else; can someone help me make a single line lua script for lua_run that will:
turn off ALL player flashlights (if they are on), i can do it for only the player that triggers it, but i want to turn out all flashlights, then lock them off (horror map…)
give a player a weapon, or parent something to them if their steamID is in a list, and possibly only affect people not in the specified list?

I’ve seen some people ask this before, but their questions were dated, and not answered, so I’m going to try to get help again

Create a map with an LUA defined brush entity to set off the script or you could have the autorun script check radius for an existing entity such as player_start and trigger it that way.

okay, did you read my post at all? i can trigger it, the entity is LUA_Run, INFO_player_start is only the spawning area, not the player, and i have no problem triggering it, all it is is a brush that says onstarttouch: lua_run: runcode, the problem is using a file in the lua folder instead of passed code that must be one line

wth? it says my desktop is running XP (it couldnt ID it yesterday), but it’s running vista,


one thing i always found peculiar about FP is the ability to look at your own post’s history, but not others, it’s weird, especially when someone can post, then immediately snip it, others may want to know what was snipped.

Either way firegod, thanks for trying to cover up your steaming rage for any non-gold members this time. but I care…

Let me try and clear this up, you have a trigger brush in the map and have an output saying “OnStartTouch lua_run <code>” because if that is the case, it wont work because there is no output lua_run and the source engine on it’s own can understand LUA. Why I was saying is code a new brush based entity in LUA with commands to trigger your code when the player enters it (a.k.a. code your wn trigger brush) and use that entity name when you make the map. If this isn’t the correct answer, please can you explain what the problem is a bit better, because I cant understand it if this isn’t the problem.

quick question: do you use GMod? Garry added a branch of LUA into it, so you CAN run (some) LUA inside the game.
lua_run is a custom entity for gmod that has a 1-line space for code, and writing all my code into one line would kill me. also, lua_run isnt an output, the 2nd line in an output list is the entity to target (lua_run entity), then the command (runcode or runpassedcode), then all the extra things that rarely need changing
it’s not going to be a mod, so i can’t really define a new brush in LUA, besides, you make new items by modifying the FGD so they don’t become “obsolete” bubbles, and coding them in either by C++ or XML, depending on the extent of the brush’s powers
thank you for coming back and actually trying to clear it up

Could you define a function inside the autorun folder and have the lua_run entity trigger that function instead? If that isn’t possible, you might get a better answer in the LUA section than here.

unfortunatly, the file is going to be packed into the map (to at least HINDER hacking into it) so autorun won’t work, as the file won’t load before the map loads, and then autorun doesnt run through again (i dont THINK)
and, thanks anyways, ill see if they have any people willing to help