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

What does Client and Server mean?When do I use them?

Asked by 5 years ago

This is a really stupid and easy question to answer but if you can provide the link to me then that will be certainly helpful

What does Client and Server mean? When do I use them? When do I use a Local script,Normal script,and a Module script?

3 answers

Log in to vote
1
Answered by
green271 635 Moderation Voter
5 years ago
Edited 5 years ago

Client and Server

The Client refers to the player that is inside the game. When you run things on the Client, the action will only happen for them.

The Server is the heart of the game. This is where most game actions take place, and where you'll do most of your work. Any action on the Server will run for every player in the game.

Types of Scripts

A LocalScript is a script that will only run on the client. Anything made in LocalScripts is only replicated to the player, not to everyone else. You should handle user inputs and gui-related things here.

Exploiters can read and steal LocalScripts, so be wary.

A LocalScript will only run in these places, and their descendants:

  • A Player's PlayerGui
  • A Player's Character
  • A Player's PlayerScripts
  • A Player's Backpack
  • The ReplicatedFirst service

A Server Script (Script) is a script that only runs on the server. It has access to all server services and the likes. Anything made on here will replicate to everyone. This is the most secure, as exploiters cannot see it's source. It's uses vary on a game-by-game basis, but most of the time you'll use server scripts to handle value changing.

A Script will only run in these places, and their descendants:

  • The Workspace service
  • The ServerScriptService service

A ModuleScript is a script that can be run on the server and the client. You reference them by using require in the script you would like to. Module Scripts are typically used for storing data, or having custom functions. If you have a function that is repeated a lot in your game, it's recommended to use a Module Script.

Exploiters can read and steal Module Scripts, so be wary.

As a general rule of thumb, if you need the server to see it, but not the client, but it in ServerStorage. If you need both or the client, put it in ReplicatedStorage.

Wikia Articles

Script LocalScript ModuleScript

0
Thanks!I think it boosted my knowledge. rochel89 42 — 5y
Ad
Log in to vote
0
Answered by
angeI1001 123
5 years ago
Edited 5 years ago

Client - the player(s) within the server.

Server - the server.

Hope this helped you.

0
Can you help me with the rest of my questions if thats ok with you? rochel89 42 — 5y
0
When you use them? Well, clientsided basically means localscripts and serverscripts (server) means serversided scripts angeI1001 123 — 5y
0
^ Too bland of an answer. There is MUCH more to clients and servers. Lugical 425 — 5y
Log in to vote
0
Answered by 5 years ago

Every player in a server has their seperate client. all the these clients together are called a server.

if you want to change something only in the 1 of the clients (the specific player) then you use a local script . you can use plr = game.Players.LocalPlayer to get the plr as a variable.

A Normal Script (AKA a server side script) is used to change things in the server.these changes get replicated into all the clients and all players are able to see the change(e.g brick color has changed color) unlike local scripts.

I havent used module scripts much so i cant really say much about them. they are called upon from a script and the code in the module script gets executed. https://www.robloxdev.com/api-reference/class/ModuleScript

Answer this question