I’m making a Formula One car chassis, it handles driving on the client through a ModuleScript, but prior to the initialization (init()
) of the ModuleScript, the player is given Network Ownership of the seat on a server-sided ModuleScript.
The issue is that the things the client does do not replicate to the server, despite the client being granted network ownership of the car seat.
I have tried to:
a) Set vehicle parent to character.
b) Give the player net. ownership of each part.
Explorer:
Explanation (chronological):
Main (Script): initializes the Server (ModuleScript).
Server (ModuleScript): waits for a VehicleSeat occupant (Seat.Changed), then gives network ownership of the vehicleseat to the player.
SeatControl (LocalScript): waits for the Humanoid to sit, if the player is in a VehicleSeat then the LocalScript initializes VControl with the VehicleSeat as a parameter. (Humanoid:GetPropertyChangedSignal("SeatPart"):Connect(function()
)
VControl (ModuleScript): only starts working 2 seconds after the player entered the seat, this is a rough estimate for the network ownership, then starts changing the AngularVelocity on CylindricalConstraints based on player input.
CLIENT
SERVER