How do you prevent the client from loading parts from the Workspace

I’m trying to have a map in which parts of it load like chunks depending on the distance from a player.
(this would be handled on the client-side and the client would bring parts from ReplicatedStorage to the Workspace)

The issue with this is if I plan to add an anticheat, since the map is essentially empty on the server-side (every player would look like they are flying)

My take on this would be to have a fully loaded map on the server, and a dynamically loaded map on the client, so that the server can actively check with raycasts if a player is cheating etc

My question is how would I prevent the client from loading the entire map (located in folders inside Workspace) upon joining the game? I could delete the parts/folders upon joining but it would be nice to prevent the replication just to avoid lag (in case if there’s too many parts)

1 Like

Compare the Vector3 position of the player’s character with the chunk to load, if the absolute distance is under a specified threshold set the Parent property of the chunk to the workspace.

The issue that I have with this is that all the parts are by default parented to Workspace (in order to have the map fully loaded on the server-side)

Unless there’s a way to selectively clone parts based on if you’re the client/server
Like this:
Client → loads chunks depending on distance
Server → loads all chunks regardless of distance

Then instead you could modify the transparency values.

1 Like

Oh I see, so have every chunk transparent by default, and change the values based on distance

Yes, that would allow for the chunks to all be loaded from the get-go.