How exactlly does the RunContext property work? Can I use that property for the following example?
I want to make an invisibility script. All clients should not be able to see the invisible player anymore.
Can I use the RunContext Property to achieve this? Or must I use two scripts:
a) local script that listens for player input + b) a server script that makes the player invisible
I couldn’t really find any usable information on how exactly the RunContext property works in this forum :c
RunContext is basically manually setting a Script to be either a server script or a client script. It’s useful only for organizational purposes because you can group both server and client scripts that are part of the same system together in ReplicatedStorage.
Note that when parenting them to containers with custom behavior like StarterPlayerScripts, you will have unintended results on the client because one script will run parented to StarterPlayerScripts and one will be cloned and parented to player.
Regarding your example: You will need to have a server script and a client script. You can use RunContext if you like to group them for organizing purposes if you like.