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.)