Can you reference something in the ServerScriptService using a local script?

I tried referencing that is something in the ServerScriptService using a local script, but it said infinite yield or it is not available.

2 Likes

Instances stored within ServerScriptService and ServerStorage are unable to be accessed directly by LocalScripts, but you can access them indirectly by using RemoteEvents or RemoteFunctions and sending a signal to a server Script. This is due to FilteringEnabled and is done for security purposes

4 Likes

No, you need to parent the instance to a place that is replicated to the client(s).

Workspace, ReplicatedStorage, etc.

3 Likes

The client can’t view things on the server which includes ServerScriptService and ServerStorage. The best way to do this would probably be to create a remote function that returns whatever you need referenced however personally I would just store whatever it is in replicatedstorage.

3 Likes

It depends; was it a variable, or an object being created?

2 Likes

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