Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make ImageButton turn invisible on mouse hover?

Asked by 7 years ago
Edited 7 years ago

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

Log in to vote
0
Answered by
Astralyst 389 Moderation Voter
7 years ago
Edited 7 years ago
  • 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)
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!! SinatraKoslov 27 — 7y
0
no probs, by the way, you don't need to upvote. just click "Accept Answer", the button should be right below this comments Astralyst 389 — 7y
0
Ohhh, Alright, done. SinatraKoslov 27 — 7y
Ad

Answer this question