Clickdetector doesnt change part color when hovering

im learning lua and tried to test stuff out with clickdetectors and i used the mousehoverenter and mousehoverleave events but for some reason they dont work, help?

local part = script.Parent.Parent
local clickdetector = script.Parent
local clickcolor = Color3.fromRGB(0, 0, 0)
local rightclickcolor = Color3.fromRGB(255, 255, 255)
local defaultcolor = Color3.fromRGB(0, 0, 255)
local hovercolor = Color3.fromRGB(12, 255, 0)

clickdetector.MouseClick:Connect(function()
	part.Color = clickcolor
	wait(1)
	part.Color = defaultcolor
end)
clickdetector.RightMouseClick:Connect(function()
	part.Color = rightclickcolor
	wait(1)
	part.color = defaultcolor
end)
clickdetector.MouseHoverEnter:Connect(function()
	part.color = hovercolor
end)
clickdetector.MouseHoverLeave:Connect(function()
	part.Color = defaultcolor
end)

(clicking does work so thats okay.)

“.color” isn’t a valid property, you need to capitalize the “c” so “Color” instead.

local click = script.Parent
local part = click.Parent

local function mouseEnter()
	part.Color = Color3.new(1, 0, 1)
end

local function mouseLeave()
	part.Color = Color3.new(0, 1, 0)
end

click.MouseHoverEnter:Connect(mouseEnter)
click.MouseHoverLeave:Connect(mouseLeave)

This is working for me.

repro.rbxm (3.1 KB)