Local script or script with 'Client' RunContext

I came up a curiosity. If i had a local script that works with client, but can’t run on workspace. And a script with RunContext ‘Client’ that can run on workspace. Which one should I use for creating games? I’m confuse.

(Any suggestions are appreciated)

I prefer using local script for creating GUI than script with run context of client.
Also detecting client sided script would be harder if you use script with client context, because its Classname will always be script.

When making cars It’s better to use script with run context of client inside of workspace because you don’t need to inject script inside of PlayerGUI.

Both are useful in their own ways… Although most of the time you should be using LocalScripts for important stuff in your game like user input stuff, camera effects, systems… etc. Stuff that you could put in StarterPlayerScripts or StarterCharacterScripts (Although i would recommend avoiding StarterCharacterScripts)

Scripts with their RunContext set as ‘Client’ can be useful for stuff like making a part’s color change only for the player that clicked on it, stuff that are so simple that putting them in StarterPlayerScripts / StarterCharacterScripts would just fill up the folder for something so small.

I just see it as a way of organizing your local scripts better.

RunContext client isn’t meant to be a replacement for LocalScripts, it’s a lazy way of replicating client stuff to anyone and the use case for this is dependant such as emitting particles, spawning stuff etc. except inputs cuz server doesn’t do that, if you need things done quickly but changing to Client means that your script is exposed to client only now that no longer can run on Server-only services and object (ServerScriptService)

you’re not supposed to use LocalScript as it’s name is suggested, they are meant to run on client side that isn’t replicated to others, it is designed to run logics that happen on ur machine locally, usually used for handling inputs and UI, server side (Script) on other side however is designed to handle logics that happen on server side where everything happens here

neither of these unless you’re making a singleplayer (but it’s gonna be pain to perfect it) I’d suggest making your main core of the game on server side rather than having them entirely on client then let all the clients know the info by using RemoteEvent

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.