About a year ago Roblox added ReplicatedScriptService for running both server and client logic in a single container, but it was later on removed with Roblox staff stating that they decided not to ship it. I am wondering on what was the reason behind it’s removal as just now I found a use case for it but since it was removed I can’t use it.
Also if there are any alternative places for storing both server and client logic, please let me know.
I don’t know their reasoning, but it seems like it might be unintuitive to use and there are existing alternatives so it would add confusion for users.
ServerScriptService for server scripts, StarterPlayer.StarterPlayerScripts for client scripts.
Both server and client scripts will run if they are descendants of a player’s character. That may be the only place they share, but I’m not certain on that.
I am pretty sure that they do both run under character however there is an issue with that as their existence relies on a player character which is not ideal for my use case.
My use case is that I have objects like doors, swords, etc that have a controller module, a server replicator, and client replicator, together they make those objects functional and smooth without noticeable delay caused by latency.
Door:Toggle() → Opens/Closes a door
When player interacts with the door, the local replicator calls the module to :Toggle() the door and sends request to server replicator, the server replicator sends request back to all players except the sender, a local replicator on different client receives the request and calls :Toggle() ultimately resulting in unnoticeable delay as the player that toggled the door will have their door opened immediately while others will have the door toggle like about 120ms later which makes the interaction seem instant since there is no way for the player on other side of the world to notice any delay as they’re not the ones that are interacting with the object.
The latency happens either way if you’re using both types of script, unless I’m misunderstanding you. This seems like it’s only a cosmetic difference to me.
This seems like a new object to me but it feels like another gate for exploiters to execute scripts, Not sure if the scripts are hidden like ServerScriptService but I don’t think they’re being hidden.