--Wheel Setup-- 

for i, child in pairs(script.Parent.Parent.Parent.FL:GetChildren()) do
	if child:IsA("UnionOperation") then child.CanCollide = false child.Name = "WheelPart" end 
	if child:IsA("Part") and not child:IsA("UnionOperation") then child.CanCollide = false 
		if (child.Shape ~= Enum.PartType.Ball) or (child.Name == "Wheel") then child.Name = "WheelPart" end
		if (child.Shape == Enum.PartType.Ball) and not child.Parent:FindFirstChild("Wheel") then child.Name = "Wheel" end
	end
end
for i, child in pairs(script.Parent.Parent.Parent.FR:GetChildren()) do
	if child:IsA("UnionOperation") then child.CanCollide = false child.Name = "WheelPart" end 
	if child:IsA("Part") and not child:IsA("UnionOperation") then child.CanCollide = false 
		if (child.Shape ~= Enum.PartType.Ball) or (child.Name == "Wheel") then child.Name = "WheelPart" end
		if (child.Shape == Enum.PartType.Ball) and not child.Parent:FindFirstChild("Wheel") then child.Name = "Wheel" end
	end
end 
for i, child in pairs(script.Parent.Parent.Parent.RL:GetChildren()) do
	if child:IsA("UnionOperation") then child.CanCollide = false child.Name = "WheelPart" end 
	if child:IsA("Part") and not child:IsA("UnionOperation") then child.CanCollide = false 
		if (child.Shape ~= Enum.PartType.Ball) or (child.Name == "Wheel") then child.Name = "WheelPart" end
		if (child.Shape == Enum.PartType.Ball) and not child.Parent:FindFirstChild("Wheel") then child.Name = "Wheel" end
	end
end
for i, child in pairs(script.Parent.Parent.Parent.RR:GetChildren()) do
	if child:IsA("UnionOperation") then child.CanCollide = false child.Name = "WheelPart" end 
	if child:IsA("Part") and not child:IsA("UnionOperation") then child.CanCollide = false 
		if (child.Shape ~= Enum.PartType.Ball) or (child.Name == "Wheel") then child.Name = "WheelPart" end
		if (child.Shape == Enum.PartType.Ball) and not child.Parent:FindFirstChild("Wheel") then child.Name = "Wheel" end
	end
end

local FL = script.Parent.Parent.Parent.FL.Wheel
local FR = script.Parent.Parent.Parent.FR.Wheel
local RL = script.Parent.Parent.Parent.RL.Wheel
local RR = script.Parent.Parent.Parent.RR.Wheel

local zfl = FL:Clone()
zfl.Parent = script.Parent.Parent.Parent.FL
zfl.Name = "Part"
zfl.Transparency = 0
zfl.CFrame = FL.CFrame

local zfr = FR:Clone()
zfr.Parent = script.Parent.Parent.Parent.FR
zfr.Name = "Part"
zfr.Transparency = 0
zfr.CFrame = FR.CFrame

local zrl = RL:Clone()
zrl.Parent = script.Parent.Parent.Parent.RL
zrl.Name = "Part"
zrl.Transparency = 0
zrl.CFrame = RL.CFrame

local zrr = RR:Clone()
zrr.Parent = script.Parent.Parent.Parent.RR
zrr.Name = "Part"
zrr.Transparency = 0
zrr.CFrame = RR.CFrame

FL.CanCollide = true
FR.CanCollide = true
RL.CanCollide = true
RR.CanCollide = true

FL.Transparency = 1
FR.Transparency = 1
RL.Transparency = 1
RR.Transparency = 1

ManualOnly = false 
SuspensionTravelF = 1
SuspensionTravelR = 1
Radio = false 
ActiveStabilityControl = false
AutoClutch = false 
Mode = "Sport"

if WHEELS_VISIBLE == false then
zfl.Transparency = 1
zfr.Transparency = 1
zrl.Transparency = 1
zrr.Transparency = 1
else
zfl.Transparency = 0
zfr.Transparency = 0
zrl.Transparency = 0
zrr.Transparency = 0
end

FL.Rotation = script.Parent.Rotation
FR.Rotation = script.Parent.Rotation
RL.Rotation = script.Parent.Rotation
RR.Rotation = script.Parent.Rotation

for _,v in pairs(FL:GetChildren()) do if v:IsA("Decal") then v:Destroy() end end
for _,v in pairs(FR:GetChildren()) do if v:IsA("Decal") then v:Destroy() end end
for _,v in pairs(RL:GetChildren()) do if v:IsA("Decal") then v:Destroy() end end
for _,v in pairs(RR:GetChildren()) do if v:IsA("Decal") then v:Destroy() end end
