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

Help with MouseEnter event on a TextButton?

The TextButton is not fading when I hover over it.

local Player = game.Players.LocalPlayer

local Play = script.Parent.Intro.Container.Play
local Loadout = script.Parent.Intro.Container.Loadout
local Settings = script.Parent.Intro.Container.Settings

repeat wait() until Player.Character

function Fade()
	for i = 1,.5,.05 do
		Play.BackgroundTransparency = i
		print(i)
		wait(.1)
	end
end

Play.MouseEnter:connect(function()
	print'enter'
	Fade()
end)

1 answer

✓ Accepted answer

Hey! I see your problem, and it is that you dont necessarily have to do the "Fade()" in the 17th line and down, all you have to do is:

local Player = game.Players.LocalPlayer

local Play = script.Parent.Intro.Container.Play
local Loadout = script.Parent.Intro.Container.Loadout
local Settings = script.Parent.Intro.Container.Settings

repeat wait() until Player.Character

function Fade()
    for i = 1, .5, .05 do
        Play.BackgroundTransparency = i
        print(i)
        wait(.1)
    end
end

Play.MouseEnter:connect(Fade)

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