Help with pet info (MouseMoved)

image
this is my index, and every time I hover over a pet, its statistics are shown to me, but if I close the index, these statistics will remain, so here’s how to fix it

script:

function Shared.Info(button: GuiButton, pet: string)
	local Main = PetInfo.Main
	
	button.MouseEnter:Connect(function()
		Local.SetStats(pet, PetsConfig.Config[pet])
		PetInfo.Enabled = true

		Main.Animation.Visible = true
		Main.Animation.Position = UDim2.fromScale(-0.5, 0.5)

		local tween = TweenService:Create(Main.Animation, animationTweenInfo, {Position = UDim2.fromScale(1.5, 0.5)})
		tween:Play()
		tween.Completed:Wait()

		Main.Animation.Visible = false
	end)
	
	button.MouseLeave:Connect(function()
		PetInfo.Enabled = false
	end)
	
	button.MouseMoved:Connect(function()
		PetInfo.Enabled = true
		Main.Position = UDim2.fromOffset(Mouse.X + 10, Mouse.Y - 20)
	end)
end

Huh? So do you still have the problem or not? if so what is the problem?

can anyone help me? (sewafkeowfkwoefkeowpgjkiaejgiaowjgoajgopajkfocpakofkoakfoak)

help me pls (sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss)

Just make the Pet Info frame’s visibility = false when the Index also closes?