adicione a funçao no script de parar de reproduzir a previa das animaçoes quando o frame…
- User
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) - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.