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

Where do Client Scripts and Server Scripts go?

I've had this question for a pretty long time, and I need the answer.

Where do Client Scripts and Server Scripts go?

I'm sort of familiar with Server Scripts either going in the Workspace or ServerScriptService.

But what about Client Scripts, and they wouldn't go in ServerScriptService since it's the Server. Is there like a ClientScriptService or what?

Much would be appreciated, thanks!

6 comments

1

just put local scripts in startergui or starterpack

1

LocalScripts must be a descendant of the player to run, so that already limits your options.

1

I highly recommend putting server scripts in ServerScriptService, as exploiters (or the client in general) can't access that service. Also as taco said, you can put your "client" scripts in StarterGui or StarterPack, although I prefer StarterGui. StarterPlayerScripts can also work too.

0

I appreciate each and every one of your replies!

1

I guess replicated first is a good place for some local scripts, if you want them to load first. A lot of local scripts go into guis if you are using them, starterplayer, and more. But I see what you mean... server scripts have their own service while local scripts don't .well, that's because, local scripts don't need a service. it just isn't necessary.

0

Thank you for ur reply Dominus, Denny, taco and Phlegethon!

2 answers

✓ Accepted answer

Understanding the basis of relationships

Before properly deciding the placement of your Script, you have to determine the relationship it has wih FilteringEnabled, and it's general purpose. The quick laydown is to remember that ClientScripts run for the Client, and ServerScripts run for the Server. Therefore whatever you're working with, following its relationship with Client-Side matters to Server-Side, should provide enough detail on the type of Script you should use.

###To understand a bit more on this, please see my simpler explanation here, and very useful links and read-ups.


After figuring out the Script type. You need to understand where a LocalScript's and ServerScript's home should be. First, let's clear up LocalScripts. Regarding FE, following the idea that LocalScripts are meant Client related affairs. It's placement should be a Descendant of a PlayerObject, These include:

####1). Character, StarterCharacterScripts ####2). Player, StarterPlayerScripts ####3). StarterPack, StarterGui

Then simply put, for ServerScripts you've got it layed down. It's preffered for them to reside in either the workspace, or ServerScriptService.


Hope this helps! if so don't forget to accept and upvote! Like me to further interpret? Comment!

2 comments

0

Explained really well, thanks

0

No problem!

Replicated storage is good for local scripts and is mainly where it should go

3 comments

1

I don't think local scripts can run in ReplicatedStorage...

0

xd

0

legend

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