So I was making buttons for my menu and I noticed if a player hovers over the button and leaves it fast enough or presses esc it still shows the full text this is the script...
function Enter() script.Parent.Parent.Parent.CharacterButton.HoverFrame.Visible=false script.Parent.Parent.Parent.FamiliarButton.HoverFrame.Visible=false script.Parent.Parent.Parent.BagButton.HoverFrame.Visible=false script.Parent.Parent:TweenSize(UDim2.new(0,173,0,75),"Out","Quad",0.25,true) script.Parent.Parent:TweenPosition(UDim2.new(0,-98,0.5,-37),"Out","Quad",0.25,true) wait() script.Parent.Parent.Text="Menu" end function Leave() wait() script.Parent.Parent.Text="E" wait() script.Parent.Parent:TweenSize(UDim2.new(0,75,0,75),"Out","Quad",0.25,true) script.Parent.Parent:TweenPosition(UDim2.new(0,0,0.5,-37),"Out","Quad",0.25,true) wait() script.Parent.Parent.Parent.CharacterButton.HoverFrame.Visible=true script.Parent.Parent.Parent.FamiliarButton.HoverFrame.Visible=true script.Parent.Parent.Parent.BagButton.HoverFrame.Visible=true wait() if not script.Parent.Parent.Text=="E"then script.Parent.Parent.Text="E" end end script.Parent.MouseEnter:connect(Enter) script.Parent.MouseLeave:connect(Leave)
I have the script in a FrameGui inside the button so that when a player clicks on the button it does not count it as them leaving the gui.
You should consider removing the unnecessary wait()s
function Enter() script.Parent.Parent.Parent.CharacterButton.HoverFrame.Visible=false script.Parent.Parent.Parent.FamiliarButton.HoverFrame.Visible=false script.Parent.Parent.Parent.BagButton.HoverFrame.Visible=false script.Parent.Parent:TweenSize(UDim2.new(0,173,0,75),"Out","Quad",0.25,true) script.Parent.Parent:TweenPosition(UDim2.new(0,-98,0.5,-37),"Out","Quad",0.25,true) script.Parent.Parent.Text="Menu" end function Leave() script.Parent.Parent.Text="E" script.Parent.Parent:TweenSize(UDim2.new(0,75,0,75),"Out","Quad",0.25,true) script.Parent.Parent:TweenPosition(UDim2.new(0,0,0.5,-37),"Out","Quad",0.25,true) script.Parent.Parent.Parent.CharacterButton.HoverFrame.Visible=true script.Parent.Parent.Parent.FamiliarButton.HoverFrame.Visible=true script.Parent.Parent.Parent.BagButton.HoverFrame.Visible=true if not script.Parent.Parent.Text=="E"then script.Parent.Parent.Text="E" end end script.Parent.MouseEnter:connect(Enter) script.Parent.MouseLeave:connect(Leave)