How to get server data for local player

I have a modulescript in ServerScriptService so the client can’t access it, and I want to keep it there, but I want the client to be allowed to access some of it to get the data locally. I tried to make a modulescript in replicatedstorage then use that module to access the one in SSS, but you can’t do that because it runs on the client. Is there a way to do this without changing the location of the Server module?

Remotes can help you with that

You could use a RemoteEvent to send the data to the client.

And if you need it, here is the documentation on RemoteEvents

1 Like

Use Remote Functions, they are basically just functions that can be used across Server and client scripts. You can set it up in a way that when fired it returns some of the module script.
RemoteFunction | Roblox Creator Documentation

Thanks, I completely forgot about remotes when I was thinking about this.

Be careful when using InvokeClient(), an exploiter can abuse it and error everything.

How so? What are they able to do with. I don’t think they can change anything other than just call it

They can make the server hang forever, lag the server and everything. It’s essentially almost like controlling the server. How to safely invoke the client

I’m going to be using InvokeServer not InvokeClient so I wont have to worry about it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.