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

When should a local script or server script be used?

Asked by
Rinextel 291 Moderation Voter
6 years ago

Title explains question.

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

A LocalScript is a Lua source container that runs Lua code on a client connected to a Roblox server. They are used to access client-only objects, such as the player's Camera. For code run through LocalScripts, the LocalPlayer property of the Players service will return the player whose client is running the script. Source

A Script in Roblox is a type of object that holds a section of Lua code. A script will execute on the server and has access only to server-side events and properties. Source

LocalScripts should be used when something only effects 1 player, if it effects more than 1 person, or everyone needs to be able to see it you use a server script

Ad

Answer this question