RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make a CFrame car driving system"
-- local script for CFrame car driving system local seat = script.Parent.VehicleSeat local wheels = { frontLeft = script.Parent.FrontLeft, frontRight = script.Parent.FrontRight, backLeft = script.Parent.BackLeft, backRight = script.Parent.BackRight } local steerAngle = 30 local speed = 60 local function updateWheels() local steer = seat.Steer local throttle = seat.Throttle wheels.frontLeft.CFrame = wheels.frontLeft.CFrame * CFrame.Angles(0, math.rad(steerAngle * steer), 0) wheels.frontRight.CFrame = wheels.frontRight.CFrame * CFrame.Angles(0, math.rad(steerAngle * steer), 0) for _, wheel in pairs(wheels) do wheel.CFrame = wheel.CFrame * CFrame.Angles(0, 0, math.rad(speed * throttle)) end end while true do updateWheels() wait() end