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

Whats the difference between a script and a local script?

Asked by
iLordy 27
8 years ago

Is there certain things a script cant do but a local script can?

0
The syntax is slightly different in some situations. You can access game.Players.LocalPlayer and other stuff local to the player with local scripts. GShocked 150 — 8y

1 answer

Log in to vote
3
Answered by
Legojoker 345 Moderation Voter
8 years ago

Local scripts rely on the existence of a client whom it modifies. Local scripts can access things specific to the player, such as the their local Camera, and LocalPlayer (to whom the script refers). They will only activate if placed in a descendant of the player's character, Backpack, PlayerGui, or the player's very own predesignated section in their userdata. These scripts are best used for manipulating GUIs, player animations, graphics, and tools, and can even help you run a player loading screen in ReplicatedFirst.

If filtering enabled is on (a setting under workspace), client actions will not replicate on the server. What this means is and this can be useful to block 3rd party exploitation programs, but requires you to use RemoteEvents to communicate with the server from the client. I highly recommend this; here's the wiki page on them http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent

Server scripts (aka Scripts) run independently of any clients, manipulating the...server. Heh. They're best used to run game logic, and have special permission to access online data, using HttpService, requesting purchase information of developer products, distributing badges to worthy players, etc. Since server scripts manipulate the server directly, filteringenabled does not interfere with their decisions as long as they are recognized by the server initially (ServerScriptService is a good way to ensure this).

I hope this helped, and if it did, don't forget to upvote!

Ad

Answer this question