Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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?

2 comments

0

Put the game script in replicated storage

0

You cant access SSS on the client/with local scripts.

1 answer

✓ Accepted answer

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.

1 comment

0

Thanks! I will try to make a script from ServerScriptService to do this, and the LocalScript to do the rest.

This discussion is preserved as it was. New answers, comments, and votes are closed.