How does internal vehicle networking work?

I’m prototyping a vehicle system and I have a few questions about how everything fits together, networking wise.

I’ve created a boat, and am using BodyThurst to move it around on the client. This is so the player has instant feedback. It seems to work well, but I’m trying to figure out exactly … how it works? How does Roblox decide who is able to apply forces on an object, in this case a boat, and replicate them to other clients? Is it the person who has NetworkOwnership?

More importantly, woulden’t it be possible for an exploiter to insert body movers and have those physics replicated? How do I handle going about making everything secure?

The most popular way to achieve this is to put an ObjectValue inside of the control GUI that gets cloned when using the vehicle.
You would then be able to control the boat via remote events that are inside the boat model such as:

-- local script
local Boat = script.Parent.ObjectValue.Value --Set to the model of the boat

Boat.RemoteEvent:FireServer() -- You are now able to fire the remote event inside of the model

--Server script
script.Parent.RemoteEvent.OnServerEvent:Connect(function()) -- script inside boat model to handle server side
--scripty stuff here

Another way to achieve this I believe is by using NetworkOwnership. Personally I’ve never used this but I know some people do and it should allow for a client to control a model and have it replicated to the server. Ive put a link to the API for network ownership below If you decide to look into it

1 Like