Gamemode's equivelant to lua/autorun/server

Hi, I’m making a gamemode, and want to migrate one of my lua/autorun files into my gamemode, where would I put it? (gamemodedirectory)/content/lua/autorun/ or (gamemodedirectory)/gamemode/autorun/
Please halp

Put them in the gamemodedirectory/gamemode folder.

You’ll need to include and AddCSLuaFile them. They won’t autorun from your gamemode folder.

You can include them in init

That’s where you would typically include and AddCSLuaFile your files. :geno:

dumb poster is dumb

Uhmm, so… for lua/autorun/server scripts, I would take the script and stick it in the “gamemodename”/gamemode/ folder, and then Addcsluafile and include it in init.lua? and lua/autorun scripts for shared.lua, and cl_init.lua for lua/autorun/client?

If that didn’t make sense, how do I make a script clientside, serverside, and shared

In the gamemodename/gamemode folder, two files are automatically executed if present: init.lua and cl_init.lua server side and client side respectively. If you want to execute a file server side, you must include it in init.lua using include( “filename” ). If you want to execute a file client side, you must include it in cl_init.lua and AddCSLuaFile it in init.lua.

So… gah il make a table
----------------| Serverside | Clientside | Shared
AddCSLuaFile-|------No ----|----init-----| init
include--------|-----init-----|—cl_init—| both

Ok, I’m pretty sure I know how to use include, (server = init, client = cl_init, shared = both)
but im not sure about AddCSLuaFile, can someone confirm that my table shows the info about AddCSLuaFile correctly? Basically what I think is how you do it is stick AddCSLuaFile(“filename”) into init.lua when you want your script clientside or shared

AddCSLuaFile sends the file to clients whether or not it’s supposed to be a client side script. You want all of your client and shared scripts to be sent.

Ok thanks