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

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

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.

2 comments

1 answer

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

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