so, I implemented this to a bigger script, however for this one its turning white and not the right color:
local origcol = script.Parent.Color
local origmat = script.Parent.Material
local mode = false
function changestate(part)
local newcol = part.Color
local newmat = part.Material
print("part col:",newcol)
if part and mode == false then
mode = true
script.Parent.Color = newcol
script.Parent.Material = newmat
print(script.Parent.Color)
elseif mode == true then
mode = false
script.Parent.Color = origcol
script.Parent.Material = origmat
end
end