Hello!
I want to make an actions system when the players can use actions.
Let imagine that player a can create a ligth that will orbit around the player.
I want that spining to be running on the client for the player who uses the action but in the server for the rest of the players. (In order to don’t use waste too much resources for players that migth not be able to see it).
I don’t want the player who uses the action to see the ligth laggy.
I know I could just run it on the client and the server and on an extra step destroy the server ligth instance from the client who uses the action, but maybe there is a cleaner way.
Any idea?
Thanks!
if you create anything on the client (such as a part), it will not get replicated to the server
just use a local script, no need to overcomplicate it
Yea, I know. The idea is create the ligth on the client, then create a second ligth on the server managed but it.
Later destroy the second ligth on the client, in order to make the player see only the client ligth and the rest of players see the server one.
Is there any clean or correct way of doing this instead of destroying the server ligth?
i guess you could use a remote event to create a light for all clients,
then instead of destroying the light on the client, simply edit it in a local script
the server will not catch those changes and will not replicate them to every client
I understand your problem, You want to replicate client to server, but sadly, Roblox doesn’t have client-to-server replication, I have a solution:
Instead of creating a light object when action occurs, Create a light object and put it somewhere in Replicated storage Already, so client and server properties would be already synced, then when you want to display light on the client, take that already synced object and move it to wherever you want in the workspace to display (DO NOT CLONE! MOVE IT!). And fire a remote event to server informing about it so there will not be any extra light on client as it has already been created when you joined the game
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.