I am making a simple car with motors and stuff, and I’m trying to set the network owner of the car to the person driving it to make it smoother but I’m not sure how to. Here’s my code:
local players = game:GetService("Players")
local chassis = script.Parent.Parent.Chassis -- This is the PrimaryPart of the car model
local vehicleseat = script.Parent
vehicleseat:GetPropertyChangedSignal("Occupant"):Connect(function()
script.Parent.Parent.Chassis:SetNetworkOwner(players:GetPlayerFromCharacter(script.Parent.Occupant))
end)
Also, I’m not sure how to do this without making the car exploitable. The car has scripts in it so I started out completely forgetting about the whole network ownership thing and just made the car work with the scripts being normal server scripts. But it had some latency to it so I made the scripts into local scripts and tried to make the car network owned by the player, but wouldn’t this make it exploitable? Is the local script thing necessary? Thanks