Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make ImageButton turn invisible on mouse hover?

I don't understand why my script isn't working...

My script:

script.Parent.MouseEnter:connect(function()

script.parent.ImageTransparency = 1
	
end)

I placed it inside a Local Script, inside the ImageButton. I checked wiki, but from the information they provide, I still don't understand what I'm missing. Can someone help?

Edit: Already had fixed the 'parent' mistake and found the problem, even if I don't quite understand it, but it works now, thanks.

1 answer

✓ Accepted answer
  • ROBLOX is case sensitive.

Make sure it's "Parent" and not "parent"

If that doesn't work, try setting "Visible" to false.

script.Parent.MouseEnter:connect(function()
script.Parent.Visible = false
end)

EDIT: Tested and this should work fine:

Make sure it's a localscript,

script.Parent.MouseEnter:connect(function()
	script.Parent.ImageTransparency = 1
end)

3 comments

0

Found problem, I had the ScreenGui placed inside a folder, for some reason it doesn't work when it's placed inside a folder, then when I took it out and left it alone (Still within StaterGui.), then it started working fine, thanks for the help, unfortunately my reputation is not high enough to vote on answers yet!!

0

no probs, by the way, you don't need to upvote. just click "Accept Answer", the button should be right below this comments

0

Ohhh, Alright, done.

This discussion is preserved as it was. New answers, comments, and votes are closed.