Recently me and a friend of mine made a module that plays a sound track. The module works perfectly fine in singleplayer but when it's used in multiplayer, it says that module was not found.
Here is the error that appears in the console when used in multiplayer:
[code]
Couldn't include file 'includes\modules\sound_vj_music.lua' (File not found) (@addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua (line 32))
[ERROR] addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua:32: Module not found!
1. require - [C]:-1
2. unknown - addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua:32
[DrVrej|3|STEAM_0:0:22688298] Lua Error:
Couldn't include file 'includes\modules\sound_vj_music.lua' (File not found) (@addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua (line 32))
[DrVrej|3|STEAM_0:0:22688298] Lua Error:
[ERROR] addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua:32: Module not found!
1. require - [C]:-1
2. unknown - addons/dark messiah snpcs/lua/autorun/vj_dms_spawn.lua:32
[/code]
The code that the error is appearing is here: (This code is located in "autorun" folder)
[code]
if (CLIENT) then
require('sound_vj_music')
sound_vj_music.Add("VJ_SpiderQueenThemeMusic","spidermonster/Dark Messiah - Avatar of the Spider Goddess.wav",161)
sound_vj_music.Add("VJ_GiantWormThemeMusic","giantworm/Dark Messiah - The Worm From The Deep.mp3",156)
end
[/code]
The module code starts like this:
[code]
module("sound_vj_music",package.seeall)
if (CLIENT) then
...
[/code]
Thanks for the help!
On single player, you are both the server and client whereas on multiplayer you are not, right?
Singleplayer you always are the server/client
Multiplayer you're the server when you host and everyone it's client (Not 100% sure)
Dedicated you always are the client
[QUOTE=NiandraLades;45398858]On single player, you are both the server and client whereas on multiplayer you are not, right?[/QUOTE]
I really don't understand CLIENT and SERVER very much. If this helps, I am the one running the server.
Well, the reason I mentioned it is because if something is working on singleplayer but not multiplayer, there may be conflictions or the issue I brought up in my first post
[QUOTE=gonzalolog;45398881]Singleplayer you always are the server/client
Multiplayer you're the server when you host and everyone it's client (Not 100% sure)
Dedicated you always are the client[/QUOTE]
(Correct me if I'm wrong), You're saying that this module will only play the CSoundPatch in it's code if the player is a Client, meaning that the server owner is basically screwed, given the fact that the module is CLIENT only?
Seems like the module weren't sent to the players, maybe making the module shared, and add an AddCSLuaFile() would fix it
Thanks for the help everyone, it's fixed.
Sorry, you need to Log In to post a reply to this thread.