Answered by
5 years ago Edited 5 years ago
So i've formatted the script it into a code block for anyone who wants to answer.
2 | local function onHoverEnter(player) |
3 | script.Parent.Transparency = 0 |
5 | local function onHoverLeave(player) |
6 | script.Parent.Transparency = 1 |
8 | ClickDetector.MouseHoverEnter:connect(onHoverEnter) ClickDetector.MouseHoverLeave:connect(onHoverLeave) |
But here's my answer.. Basically you want to show the part when the mouse hovers over it, then make it invisible as it leaves. Sounds simple enough.
As far as i'm aware your script is pretty much spot on but it's missing some stuff.
2 | local function onHoverEnter(player) |
3 | script.Parent.Transparency = 0 |
5 | local function onHoverLeave(player) |
6 | script.Parent.Transparency = 1 |
8 | ClickDetector.MouseHoverEnter:connect(onHoverEnter) ClickDetector.MouseHoverLeave:connect(onHoverLeave) |
All i've done is put an end on the loop to mark the end of the loop (pretty self explanatory).
I also changed while true do to while wait() do to avoid crashing.
The loop itself isn't necessary and can be removed if you wish, i dunno what you plan to do with it but the current script will run just fine without it
(if you do remove the loop remember to remove the end at the bottom as well)
Anyway hope this helped :D