-- Buttons Script
local tweenInfoPopups = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local Popup = {
Settings = "Settings",
Credits = "Credits"
}
for buttonName, frameName in pairs(Popup) do
local button = script.Parent:FindFirstChild(buttonName)
local popupframe = script.Parent.Parent.Popups:FindFirstChild(frameName)
button:WaitForChild("TextButton").MouseButton1Click:Connect(function()
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("TextButton") then
v.Visible = false
end
end
tweenService:Create(script.Parent, tweenInfoPopups, {Position = UDim2.new(0.5,0,1.25,0)}):Play()
tweenService:Create(script.Parent.Parent.Title, tweenInfoPopups, {Position = UDim2.new(0.5,0,-1.25,0)}):Play()
for i, x in pairs(script.Parent.Parent.Popups:GetChildren()) do
if x:IsA("Frame") then
x.Visible = false
x.Position = UDim2.new(0.5,0,1.5,0)
end
end
popupframe.Visible = true
tweenService:Create(popupframe, tweenInfoPopups, {Position = UDim2.new(.5,0,.5,0)}):Play()
end)
end