remova a funçao do music_note, textbutton, Imagelabel X e o textbutton e subistutia para…
- User
remova a funçao do music_note, textbutton, Imagelabel X e o textbutton e subistutia para abrir o frame com a animaçao com um novo textbutton que eu irei criar : local Utility = {}
--// services local TweenService = game:GetService('TweenService')
--// variables local AnimationFrame = script.Parent.Parent.MainFrame local ToggleButton = AnimationFrame.Parent.toggle local Player = game.Players.LocalPlayer local scroll = script.Parent.Parent.MainFrame.Content.ScrollingFrame
-- Tween local function tween(obj, assignedProperty, assignedValue, completeTime, easingStyle, easingDirection) TweenService:Create(obj, TweenInfo.new(completeTime, easingStyle or Enum.EasingStyle.Quint, easingDirection or Enum.EasingDirection.Out), { [assignedProperty] = assignedValue }):Play() end Utility.Tween = tween
-- Utility.SetupSectionButton() local SelectedSectionButton = nil function Utility.SetupSectionButton(sectionButton, sectionName) sectionButton.MouseButton1Up:Connect(function() Utility.DisableSectionButtons(sectionButton) SelectedSectionButton = sectionButton tween(sectionButton, 'BackgroundColor3', Color3.fromRGB(255,255,255), 0.5) tween(sectionButton, 'BackgroundTransparency', 0.3, 0.5) tween(sectionButton, 'TextColor3', Color3.fromRGB(0,0,0), 0.5) Utility.Query(sectionName) end) sectionButton.MouseEnter:Connect(function() if SelectedSectionButton ~= sectionButton then tween(sectionButton, 'BackgroundColor3', Color3.fromRGB(30,30,30), 0.5) end end) sectionButton.MouseLeave:Connect(function() if SelectedSectionButton ~= sectionButton then tween(sectionButton, 'BackgroundColor3', Color3.fromRGB(10,10,10), 0.5) end end) end
-- Utility.DisableSectionButtons function Utility.DisableSectionButtons(exception) for i,v in pairs(AnimationFrame.Sections:GetChildren()) do if v:IsA('TextButton') and v ~= exception then tween(v, 'BackgroundColor3', Color3.fromRGB(10,10,10), 0.5) tween(v, 'BackgroundTransparency', 0.7, 0.5) tween(v, 'TextColor3', Color3.fromRGB(255,255,255), 0.5) end end end
-- Utility.SetRunningAnimation() local SelectedButton = nil local PlayingAnimation = nil function Utility.SetRunningAnimation(button) if SelectedButton then tween(SelectedButton, 'BackgroundColor3', Color3.fromRGB(10, 10, 10), 0.5) tween(SelectedButton, 'BackgroundTransparency', 0.7, 0.5) if SelectedButton == button then if PlayingAnimation then PlayingAnimation:Stop() end SelectedButton = nil PlayingAnimation = nil return end end SelectedButton = button tween(SelectedButton, 'BackgroundColor3', Color3.fromRGB(255,255,255), 0.5) tween(SelectedButton, 'BackgroundTransparency', 0.7, 0.5) if PlayingAnimation then -- stop the running animation PlayingAnimation:Stop() end -- load new animation PlayingAnimation = Player.Character.Humanoid.Animator:LoadAnimation(button.WorldModel.Animation) -- Set the animation priority to "Action" PlayingAnimation.Priority = Enum.AnimationPriority.Action PlayingAnimation:Play() end
-- Utility.SetupNewButton() function Utility.SetupNewButton(newButton) newButton.MouseEnter:Connect(function() if SelectedButton ~= newButton then tween(newButton, 'BackgroundColor3', Color3.fromRGB(100, 100, 100), 0.5) end end) newButton.MouseLeave:Connect(function() if SelectedButton ~= newButton then tween(newButton, 'BackgroundColor3', Color3.fromRGB(0,0,0), 0.5) end end) 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.