Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why dosen't a LocalScript recgonize a child of ServerScriptService?

Asked by
Vik954 48
5 years ago

I work on a game and I made a LocalScript in the StarterPlayerScripts folder and in the line game:GetService("ServerScriptService").GameScript:GetChildren()[i].Player.Value == nil it says that GameScript is not a member of ServerScriptService . Why?

0
Put the game script in replicated storage Sapppower 17 — 5y
0
You cant access SSS on the client/with local scripts. xJigoku 17 — 5y

1 answer

Log in to vote
2
Answered by 5 years ago

ServerScriptService and ServerStorage contents are inaccessible to clients.

The whole point of ServerScriptService is for server scripts.

The client cannot, and does not, need to access the contents of these services.

They will see the service, just not the children of it.

Move the children of GameScript to ReplicatedStorage, a service whose contents are replicated to the server and client, or handle the logic concerning these children on the server side.

0
Thanks! I will try to make a script from ServerScriptService to do this, and the LocalScript to do the rest. Vik954 48 — 5y
Ad

Answer this question