Im trying to make a script that teleports the player into the car but there is a problem. When the player is teleported into the seat the vehicle is not driveable and the A-Chassis UI is not visible. Here is my current code
function RaceManager:seatPlayers()
local startingPositions = StartingPositions:GetChildren()
local playerNames = {}
for i, player in ipairs(self.enteredPlayers) do
table.insert(playerNames, player.Name)
local carClone = Cars.CarTemplate:Clone()
carClone.Parent = game.Workspace
carClone.Name = player.Name .. "'s Car"
local verticalOffset = Vector3.new(0, 5, 0)
carClone:SetPrimaryPartCFrame(startingPositions[i].CFrame * CFrame.new(verticalOffset))
self:loadCharacter(player)
self:waitForCharacter(player)
local seat = carClone:WaitForChild("DriveSeat")
seat:Sit(player.Character:FindFirstChildOfClass("Humanoid"))
end
end
If you know of a solution please let me know, Thanks in advance!