I’m trying to write a lighting system for my game using nested tables in a ModuleScript, but every time I try to call the event, the function returns nil, as demonstrated in the below screenshot.
These are the tables that’re being referenced. You can see that "ChamberSpotlights.Off" is a function.
When the event is fired, the function module is required and separates a string to index the tables with this function (thanks TheNexusAvenger for helping me figure this part out.)
Neither of us can figure out what’s wrong here so I’m making this post as a last-ditch effort to understand why this error is happening in the first place.
The variable On is being set to your anonymous function function() end, which returns nil, you are basically not assigning the keys to functions, youre setting them to the return values of the functions