I just wanted to ask what the point of using Local scripts is over a normal script. I know what local scripts do, however I m not sure for what sort of scenario we would be using them over normal scripts. Any replies relating to the topic would be really helpful. Thanks in advance.
Have a nice day!!!
To start of with, there are a lot of functions commonly used which are not available on the server. There are also certain scenarios where you do not want to replicate actions of the client to other players.
While it may not be super relevant to your question, this article explains some more things about the client-server model.
Edit: The client is also often better suited for resource intensive tasks where you for example might be required to render something constantly.
Severscripts run on the server, localscripts run on clients computer.
You usually use localscripts for scriptting GUIs, making changes on workspace that only that client in question should see and detecting user input detection.
They are great for running tweens locally. A rotating coin as a pickup could be run in a local script, so all the rotations are not sent from server to client.
Thank you guys for your replies, reading these gives me a better idea as to why we would use Local Scripts. Many thanks!!!
Server scripts would be used when you either wanna hide information from the client, affect the whole server, or for general security.
Local scripts would be used when you wanna affect solely the client, not sending sensitive information, and as a easier way to get player information.
So lets say we would want like all the prisoners in the server, like Jailbreak, to wear prisoner clothes, would we use a server script for that or a local script?
Server Script, with an OnPlayerAdded or OnCharacterAdded and cloning the clothes from ServerStorage.
oh ok thank you, I thought it was server script too