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

How do I make a GUI display once the player has hovered their mouse over a npc in a folder?

Asked by 2 years ago

To sum it up, I have a folder that stores all the mobs in my game and I want to make it so when a player hovers over the mob it displays their health, and when they stop it stops displaying their health through a GUI.

I've used Mouse.Target and got the basic part which is displaying the UI. However upon me stopping to hover over it, it still has the UI.

Here's my script:

function ishovering(target)
    if mouse.Target:IsA("BasePart") and mouse.Target.Parent:FindFirstChild("Humanoid") then
        healthmod.Setup(mouse.Target.Parent, true)
    else
        print("not a npc")
    end
end

Answer this question