Hello, I want to fix this issue I’ve been having for a while where in my local script used to register inputs and run vfx module scripts, it wouldn’t run any code after or on the line when the module script tries to load. This is very bizarre as it works just fine in studio. I’ve tried searching for this online but they were simple mistakes like not using :WaitForChild() when requiring the module script which I already do, It also seems that’s the only forum which remotely relates to my issue. I honestly have no clue on how to debug this just cause of the fact that it works in studio. I’ll include the code block that loads the modules and screenshots of the path. Hoping this really is just a rookie mistake on my part.
Also, for some extra info, there aren’t any errors in the actual game that I can see; it’s completely silent.
module script loading code:
-- vfx modules
local vfxmodules = game:GetService("ReplicatedStorage").VFXMODULES
local DragonSlayerSlamModule = require(vfxmodules:WaitForChild("DragonSlayerSlam")) -- doesn't load this line or anything after it
local DragonSlayerSlashModule = require(vfxmodules:WaitForChild("DragonSlayerSlash"))
local RockSpawnModule = require(vfxmodules:WaitForChild("RockSpawner"))
Btw, I’ve moved the code around and it only stops when it tries to load the modules so I’m pretty sure it is the module scripts that are causing the issue.
here’s the path:
I don’t exactly know what info you need to help me with this, but please just let me know what I need to give.
I am confused, is it a Local Script or Server Script that is requiring these modules?
Otherwise this is the only thought on my mind to what could be causing it.
If a ModuleScript is attempting to require another ModuleScript that in turn tries to require it, the thread will hang and never halt (cyclic require calls do not generate errors). Be mindful of your module dependencies in large projects! ModuleScript | Documentation - Roblox Creator Hub
The only module that is required in the DragonSlayerSlamModule is the RockSpawn module, which doesn’t require the DragonSlayerSlam module. For the other modules, they also don’t have any modules that require themselves either.
My problem was that in my DragonSlayerSlamModule I had tried to wait for the character by doing LocalPlayer.CharacterAdded:Wait() and then setting my character var, so I did this instead.
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()