So this script makes the cursor (on hover) show a gui displaying the name of the item next to the cursor.
For some reason, every time i move the cursor just a little on the brick again, it will do the fading process AGAIN.
repeat wait() until game:GetService("Players").LocalPlayer
local found = game.Players.LocalPlayer:FindFirstChild("PlayerGui")
local gui = found:FindFirstChild("HoverGui")
game.Workspace.hover.ClickDetector.MouseHoverEnter:connect(function()
gui.HoverFrame.Label.Text = "Brick"
for i=1,0,-0.05 do
gui.HoverFrame.Label.TextTransparency = i
gui.HoverFrame.Label.BackgroundTransparency = i
wait()
end
script.Disabled = true
end)
game.Workspace.hover.ClickDetector.MouseHoverLeave:connect(function()
for i=0,1,0.05 do
gui.HoverFrame.Label.TextTransparency = i
gui.HoverFrame.Label.BackgroundTransparency = i
wait()
end
end)
I want the fading process to happen once only and it can be activated again after the mouse leaves from the brick.

1 comment
You simply can't use script.Disabled because it is a bit buggish and it keeps events. Add a variable, "local work = true". replace script.Disabled with "work = false", and then add an if statement to HoverEnter/HoverLeave to make sure work == true before running