The issue I’m having is that when StaminaManager.setTestValue(newValue) is called from one local script, the other local script is unable to see the newly set value using StaminaManager.getTestValue().
Furthermore, when I set the testValue from LocalScriptA, the event connection for testValueChanged within LocalScriptA only receives the fired signal. It’s the same when I set the testValue from LocalScriptB, the testValueChanged event connection within LocalScriptB only receives the fired signal.
What I'm trying to achieve
I would like for the changes to testValue from one local script be visible to the other local script. From my current understanding of module scripts, since this module script is being required from two local scripts which have the same run environment (the client), I would expect this to be the deafult behavior, but now I’m just confused.
Ok, so I plugged my dev forum post into chatgpt and it pointed out that the likely issue is that LocalScriptA and LocalScriptB aren’t actually requiring the same module script and that I should check the paths to make sure each LocalScript is requiring the same path.
I thought at first, how could this be? since I don’t ever recall cloning StaminaManager during runtime, but then I realized that StaminaManager was in StarterCharacter scripts, and so was LocalScriptA, but not LocalScriptB.
So ultimately, the problem was that LocalScriptA was requiring a replicated version of StaminaManager while LocalScriptB was requiring the original version of StaminaManager, which why they weren’t sharing their values
That came to mind for me too, but I made sure that the testValueChanged connection was connected before using setTestValue(). Thanks for your input though