adicione  a funçao no script de parar de reproduzir a previa das animaçoes quando o frame for fechado clicando no togglebutton : -- Welcome to Animify V2

--[[
    Version: 2.4
    Documentation and API Link: https://devforum.roblox.com/t/2462029

    Credits: Programmed by @4vials, designed by @ParadoxAssets
    Contributors: @SaintImmor, @Bloxmaster998144
--]]

local Controller = setmetatable({}, {
	__index = require(script:WaitForChild('Configuration'))
})

local Sections = {} -- cache to destroy when refreshing

-- UI Components
local AnimationGUI = script.Parent
local AnimationFrame = AnimationGUI:WaitForChild('MainFrame')
local ToggleButton = AnimationGUI:WaitForChild('toggle')

-- Dependencies
local Assets = script:WaitForChild('Assets')
local Player = game.Players.LocalPlayer

-- Animation Modules
local SectionsFolder = script:WaitForChild('Sections')
local Utility = require(script.Utility)

-- Controller variables
Controller.Frame = AnimationFrame
Controller.Enabled = false

-- Internal Variables
local PlayingAnimation = nil

-- Constants
local Positions = {
	Open = UDim2.new(.5, 0, .5, 0),
	Closed = UDim2.new(.5, 0, 2, 0)
}

-- Funcs
local tween = Utility.Tween

local function AddSection(sectionName: string)
	if Sections[sectionName] then
		warn(sectionName..' already exists')
		return
	end

	local sectionButton = Assets.SectionButton:Clone()
	sectionButton.Parent = AnimationFrame.Sections
	sectionButton.Text = sectionName

	Utility.SetupSectionButton(sectionButton, sectionName)

	Sections[sectionName] = {sectionButton}

	return Sections[sectionName]
end

local function AddAnimation(sectionName: string, animationTitle: string, animationID: number)
	task.defer(function()
		local section = Sections[sectionName] or AddSection(sectionName)

		local newButton = Assets.AnimationButton:Clone()
		newButton.Parent = AnimationFrame.Content.ScrollingFrame
		newButton.Label.Text = animationTitle
		newButton:SetAttribute('Section', sectionName)

		local animation = Instance.new('Animation')
		animation.Parent = newButton.WorldModel
		animation.AnimationId = 'rbxassetid://'..animationID

		local avatar = nil

		-- Usar o próprio personagem do jogador para a pré-visualização
		local character = Player.Character or Player.CharacterAdded:Wait()
		local humanoid = character:WaitForChild("Humanoid")
		local rigType = humanoid.RigType

		local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(Player.UserId)
		avatar = game.Players:CreateHumanoidModelFromDescription(humanoidDescription, rigType)
		avatar.Parent = newButton.WorldModel

		-- Ajustar o tamanho do modelo na pré-visualização
		avatar:SetPrimaryPartCFrame(CFrame.new(0, 0, 0))

		task.wait()
		local loaded = avatar:WaitForChild('Humanoid').Animator:LoadAnimation(animation)
		loaded.Looped = true
		loaded.Priority = Enum.AnimationPriority.Action
		loaded:Play()

		-- Configurar a câmera para a pré-visualização
		local Camera = Instance.new("Camera")
		Camera.Parent = newButton.WorldModel
		Camera.Name = "CurrentCamera"
		Camera.CFrame = CFrame.lookAt(
			(avatar.HumanoidRootPart.CFrame * CFrame.new(0, 0, -Controller.ViewDistance)).p,
			avatar.HumanoidRootPart.Position + Vector3.new(0, 0, 0)
		)
		newButton.CurrentCamera = Camera

		newButton.TextButton.Activated:Connect(function()
			Utility.SetRunningAnimation(newButton)

			if Controller.HideUiOnSelect then
				-- hide the ui 
				Controller.CloseGui()
			end
		end)

		Utility.SetupNewButton(newButton)

		table.insert(section, newButton)
	end)
end

-- Controller.AddAnimation() 
function Controller.AddAnimation(sectionName: string, animationTitle: string, animationID: number)
	if type(animationID) ~= "number" then
		if type(animationID) == 'string' then
			if string.find(animationID, 'rbxassetid://') then
				animationID = tonumber(string.split(animationID, '://')[2])
			end
		end
	end
	if not sectionName or not animationTitle or not animationID then
		warn(('Controller.AddAnimation() Missing Argument %s'):format((not sectionName and '"sectionName"')) or (not animationTitle and '"animationTitle"') or '"animationID"')
		return
	end
	AddAnimation(sectionName, animationTitle, animationID)
end

-- Controller.Refresh()
function Controller.Refresh()
	for _, section in pairs(Sections) do               
		for _, button in pairs(section) do
			button:Destroy()
		end
	end
	table.clear(Sections)
	for _, section in pairs(SectionsFolder:GetChildren()) do
		local section_name = section.Name
		AddSection(section_name)

		local animations = require(section)
		local anim_list = {}
		for anim_name, id in pairs(animations) do
			table.insert(anim_list, {name = anim_name, id = id})
		end

		-- Ordenar os emotes em ordem alfabética
		table.sort(anim_list, function(a, b)
			return a.name:lower() < b.name:lower()
		end)

		-- Adicionar as animações em ordem alfabética
		for _, anim in ipairs(anim_list) do
			Controller.AddAnimation(section_name, anim.name, anim.id)
			task.wait()
		end
	end
end

-- Controller.ToggleState()
function Controller.ToggleState()
	Controller.Enabled = not Controller.Enabled
	if not Controller.Enabled then
		tween(AnimationFrame, 'Position', Positions.Closed, 0.5)
		Utility.DisableToggleButton()
	else
		tween(AnimationFrame, 'Position', Positions.Open, 0.5, Enum.EasingStyle.Back)
		Utility.EnableToggleButton()
	end
end

ToggleButton.TextButton.MouseButton1Down:Connect(Controller.ToggleState)

-- Controller.CloseGui()
function Controller.CloseGui()
	tween(AnimationFrame, 'Position', Positions.Closed, 0.5)
	Utility.DisableToggleButton()
end

-- Controller.OpenGui()
function Controller.OpenGui()
	tween(AnimationFrame, 'Position', Positions.Open, 0.5, Enum.EasingStyle.Back)
	Utility.EnableToggleButton()
end

-- Controller.DisableToggle()
function Controller.DisableToggle()
	ToggleButton.Visible = false
	Utility.DisableToggleButton()
end

-- Controller.EnableToggle()
function Controller.EnableToggle()
	ToggleButton.Visible = true
end

-- last
Utility.SetupSectionButton(AnimationFrame.Sections.All, nil)

-- Apply global settings
if Controller.SectionsEnabled then
	AnimationFrame.Sections.Visible = true
else
	AnimationFrame.Sections.Visible = false
end

if Controller.KeyBind then
	if typeof(Controller.KeyBind) ~= 'EnumItem' then
		warn('Invalid keybind, must be an Enum.KeyCode')
	else
		game:GetService('UserInputService').InputBegan:Connect(function(inputObject, gameProcessedEvent)
			if gameProcessedEvent then
				return
			end
			if inputObject.KeyCode == Controller.KeyBind then
				Controller.ToggleState()
			end
		end)
	end
end

if Controller.ToggleButton then
	Controller.EnableToggle()
else
	Controller.DisableToggle()
end

if Controller.LoadOnRequire then
	Controller.Refresh()
end

return Controller