Hello,
- What do you want to achieve? Keep it simple and clear!
So, I have:
• a ModuleScript inside my ServerScriptService.
• a LocalScript inside the StarterCharacterScripts
• and a Script inside my Workspace, that triggers a function when its Parent is touched
The idea is that my LocalScript is used to initialize a part of the GUI (a bottom HUD bar, that changes color depending on a StringValue)
The Script inside the Workspace, that triggers a function when its Parent Part is touched also updates the GUI in the same way as the LocalScript
That is why I’m using a ModuleScript: because I’d like to avoid repeating myself. (I’ll use the same function in other scripts too)
However…
- What is the issue? Include screenshots / videos if
The thing is that I’m using a Script in my workspace (LocalScripts don’t work there if I remember correctly) and my ModuleScript is in the same place as my LocalScript: inside the StarterCharacterScripts. Which of course, causes infinite yielding (yay).
So, big brain time, I’ll save my ModuleScript in the ServiceScriptService service: now the infinite yielding is inside the LocalScript (yes, I changed the require()'s argument)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Solutions that I’ve tried are mentionned up there:
• Moving the ModuleScript to ServiceScriptService
I also tried this:
• Changing my LocalScript to a regular Script, inside StarterCharacterScripts, but I will not be able to access the LocalPlayer object (which I need in the ModuleScript, because I want to change the player’s HUD)
If you need more details tell me, I tried my best to explain the original problem, and my native language is french, so please excuse any grammar mistakes.
Thank you guys for reading