Here is the script:
local kmag = script.Parent.kmag
local carname = nil
kmag.Event:Connect(function(status, carname, color)
if status == "carselection" then
script.carnamee.Value = carname
elseif status == 'color' then
local carname = script.carnamee.Value
local car = workspace.car:FindFirstChild(carname)
for i, parts in pairs(workspace.car[carname].Body:GetChildren()) do
if parts.ClassName == "MeshPart" then
if parts.BrickColor == BrickColor.new(script.prev.Value.Color) then
parts.BrickColor = color
end
end
pcall(function()
parts.Parent.FLdoor.LF_door.BrickColor = color
parts.Parent.FRdoor.RF_door.BrickColor = color
end)
pcall(function()
parts.Parent.FLdoor.L_door.BrickColor = color
parts.Parent.FRdoor.R_door.BrickColor = color
end)
parts.Parent:FindFirstChild("RL_door")
pcall(function()
parts.Parent.RLdoor.LR_door.BrickColor = color
parts.Parent.RRdoor.RR_door.BrickColor = color
end)
script.prev.Value = color
end
end
end)
It is a local script inside of the GUI that the GUI on screen is on; here is the video:
yes I know the GUI is bad, its just a placeholder as I try to get this working