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

How to make when i hover my moues at part it a gui show and hide when i hover out?

Asked by 7 years ago

Alright, so i tried to make when i hover my mouse over a part a gui show then when i hover out of the part the gui hide i tried the following script i inserted the script inside the part and the gui inside the script which is inside the part, here is the script:

function boop(Player)
    if not Player.PlayerGui:FindFirstChild("Gui") then
        local gui = script.Gui:clone()
        gui.Parent = Player.PlayerGui
        gui.LocalScript.Disabled = false
    end
end
script.Parent.ClickDetector.MouseHoverEnter:connect(boop)

I also inserted a localscript inside the gui here is it:

wait(3)
script.Parent:Destroy()

It works on studio when i hover at the part the gui shows after 3 seconds it hides and when i hover again it shows again but when im in-game it shows only once and never shows again.

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Do:

script.Parent.ClickDetector.MouseHoverEnter:connect(function(Player)
-- put stuff here
end)

make sure you add this to your part and make sure you have a ClickDetector in the part

Ad

Answer this question