Why not do…
function rotateWheel(wheel, wheelAngle, mainPart)
for _, v in pairs(mainPart:GetChildren()) do
if v.Name == wheel.Name then
v.C0 = CFrame.new(v.C0.Position) * CFrame.Angles(0, math.rad(wheelAngle), 0)
end
end
end
if wheel.Name == "FL" or wheel.Name == "FR" then
rotateWheel(wheel, wheelAngle, mainPart)
end