EDIT: It appears this problem was caused, for some reason, by the need for a wait before setting up the callbacks.
So recently I've been working on a system that allows the users to quickly and easily put together games with pre-made assets (this is for a war clan). I would use an uploaded ModuleScript that gets required by its asset ID.
The problem is, one of my GUIs (a health/shield display, specifically), is not working properly, and I can trace this problem down to the LocalScript in charge of it. The script runs fine, and it prints out right at the bottom when it is completed. But, Humanoid event callbacks do not fire.
And the most perplexing thing is, the script works as it is intended (with the callbacks) when it originally came from the StarterGui - the problem only occurs when it is cloned/re-parented from the ModuleScript. I have tested a variety of different methods, including disabling/enabling the script, but nothing has changed. I even tried disabling/enabling the script later on to see if anything would change. Nothing did.
Here is the code for the LocalScript: https://hastebin.com/wedacibato.lua
And the relevant part of the code in the ModuleScript:
local GuisLocation = DecodeLocation(Settings.GuisLocation)
for _,Gui in pairs (Guis:GetChildren()) do -->> Guis a variable defining a folder inside the ModuleScript
Gui:Clone().Parent = GuisLocation
end
Hope someone can figure this out
Thanks ;)
~TDP
