✓ Accepted answer
When you are using a ModuleScript, the module will be ran by the type of script that you require it with. So say you ran
local hlFunc = require(game:GetService("ServerStorage"):FindFirstChild("ModuleScript"));
That would allow you to run it as a Server Script and allow the ModuleScript to run InvokeClient(), whereas requiring it from a LocalScript will run it as a LocalScript from whichever player's client the script is on (All of them unless you only put it in a certain player)
local hlFunc = require(game:GetService("ServerStorage"):FindFirstChild("ModuleScript"));
Requiring it in the LocalScript would error because you cannot run InvokeClient() from a client.
If this help, that's awesome! If it didn't and you're still confused feel free to ask any other questions to have about it, or ask me to clarify what confused you.
1 comment
this kinda helped i had a little slip up in my code randomly cause i accidentally coppied some code and still had an invokeclient() in there even tho its client tho, but i am still accepting this as it teeached me a bit of module scripts, thaanks