So basically I was working on the game, and as everybody i am using modules. BUT! Here's thing: my game uses a lot of different techniques, and i decided to make a separate local script for every single one. So in general i have like 5 local scripts and some server scripts, and they structurize the code. BUT! I somehow need to get the SELF for players which would be synchronized with each other. And i got no clue how to do it properly.
So i tried to make a module that would be making like "new characters" (basically Module.new(player)) if the SELF for player is not existing. If it does, it returns the SELF for the player which is stored inside of the table in module script.
I thought it will work but nope.
Every time i try to launch the scripts, it just says like "attempt to index nil with FindFirstChild() etc (basically Character is not being found in the SELF for player, even though Module script creating a self for player which includes the character.
My system is somehow broken and the problem with SELFs is the one problem that stops me from making game.
Here's all of the code parts that get the SELF for player for everything to work.
If you have another idea how to manage this garbage, dm me or write here your idea. Thanks.
** You are now Level 3! **