I have used this kind of script before, but I just don't know why it doesn't work anymore.
The Transparency
is meant to change to 0.5 when it is clicked and 0 when it is clicked again.
And I'm not sure if an update changed something, I've been offline for a while.
edit
The transparency works now but doesn't switch back to zero. I just needed to switch the numbers around.
Here's the code I tried:
local door = script.Parent local click = script.Parent.ClickDetector local hoverbox = Instance.new('SelectionBox', door) hoverbox.Visible = false local clickdoor = function() door.CanCollide = not door.CanCollide door.Transparency = not door.Transparency and 0.5 or 0 end local hoverdoor = function() hoverbox.Visible = true end local nothoverdoor = function() hoverbox.Visible = false end click.MouseClick:Connect(clickdoor) click.MouseHoverEnter:Connect(hoverdoor) click.MouseHoverLeave:Connect(nothoverdoor) hoverbox.Adornee = door
The CanCollide
setting is correct, however. So I'm wondering if you can't use and 0.5 or 0
anymore.