Module Script not running for Server

I have a modulescript in replicated storage that is accessed by the client, but i want it to search through all the players in the game and change something in their playergui. The problem is, I keep getting the “PlayerGui is not a valid member of __” error. I think this is because the module script is client sided as of right now, because the client can only access their specific playergui and not others. How would I get the module script to run this code for the server?