• SERVER, CLIENT
    4 replies, posted
Hi, I'm learning now creating SWEP and I got stupid question: I got only file shared.lua. I use here [LUA] if SERVER then end --and if CLIENT then end [/LUA] Is there any difference between my way and having 3 files (cl_init.lua, init.lua, shared.lua) ?
There isn't, using multiple files just organizes things.
2 options when you're making a SWEP: You stuff everything in shared.lua and use if SERVER then and if CLIENT then, or you could just simply make a cl_init.lua, init.lua, and shared.lua..
Thank You guys!
Yeah, having multiple files organizes things, unless you're Garry and put shit in one script that should be in another for some unknown reason. This is why I'd just suggest going with checking if SERVER or CLIENT blah blah, but make damn sure you comment your code so that you and anyone else that will potentially work on it knows what is what. Also, just to specify, SERVER and CLIENT return a boolean value (true/false,) so use them as such.
Sorry, you need to Log In to post a reply to this thread.