Creating server-sided build tools?

So i want to create a set of tools that allow the player to create and modify parts (move, scale, copy, delete, etc). I’ve taken a look at several of the pre-existing roblox gears that were created to do this, as well as some tools that were uploaded to the toolbox, to get a general idea of what i may need to do. However, most if not all of the tools i looked at only work on the client side, and not replicated to the server. I took a look at the way F3X building tools goes about it, but I’m still confused (my knowledge of modulescripts and client-server communication is limited, so I’m not sure what’s going on with it). Does anyone know how I might go about this? I think I might be able to use remotefunctions to do it, but I’m not sure in what context I would want to use them.

3 Likes

You only have to use things related to the player mouse in a local script, so everything that doesn’t use a mouse can just be fired in a server script with a remote event.

but wouldn’t I want to fire the remote even in the local script and then have the OnServerEvent code in the server script as well?

If you are suggesting taking input, passing it to the server and then processing it on the server, there would be a considerable latency between input and result, which is undesirable. The client needs to process the input first and then the server can process it.

1 Like

Alright, I think I have a general idea of how things work, both after looking into remoteevents a little more and messing around with some of the preexisting tools further.

Just one last question: when it comes to the Dragger object, when dragging a part, it is able to perfectly position a part in a grid-like fashion, however it often leads to parts being placed on weird decimals, even if they look properly aligned. Is there any way to get these grid values elsewhere (e.g. make it so a spawned part is automatically placed at the nearest spot within this grid)?

Apologies if I’m not explaining it correctly, or if it’s even appropriate to respond with a followup question like this.

That is probably floating point precision errors. Maybe you can get rid of it by rounding the value but for some numbers (like 0.3 I think) they will never be the exact value