local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")
local blur = Lighting.MainGuiBlur
local GUI = script.Parent
local title = GUI.Title
local buttons = GUI.Buttons
local PlayFrame = buttons.APlayFrame
local SettingsFrame = buttons.BSettingsFrame
local ShopFrame = buttons.CShopFrame
local CreditsFrame = buttons.DCreditsFrame
local SettingsMenu = GUI.SettingsMenu -- Меню настроек
local PlayButton = PlayFrame.Play
local SettingsButton = SettingsFrame.Settings
local ShopButton = ShopFrame.Shop
local CreditsButton = CreditsFrame.Credits
blur.Enabled = true
SettingsMenu.Size = UDim2.new(0, 0, 0, 0)
SettingsMenu.Visible = false
local interfaceTweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local blurTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local function createTween(target, goal, tweenInfo)
return TweenService:Create(target, tweenInfo, goal)
end
local function onMouseEnter(frame)
if frame:IsA("Frame") or frame:IsA("TextButton") then
local originalSize = frame.Size
local newSize = UDim2.new(originalSize.X.Scale * 1.1, originalSize.X.Offset * 1.1, originalSize.Y.Scale * 1.1, originalSize.Y.Offset * 1.1)
createTween(frame, {Size = newSize}, interfaceTweenInfo):Play()
createTween(frame, {BackgroundColor3 = Color3.new(0.245902, 0.245902, 0.245902)}, interfaceTweenInfo):Play()
local button = frame:FindFirstChildWhichIsA("TextButton")
if button then
createTween(button, {TextColor3 = Color3.fromRGB(239, 196, 40)}, interfaceTweenInfo):Play()
end
end
end
local function onMouseLeave(frame, defaultSize, defaultColor, defaultTxtColor)
if frame:IsA("Frame") or frame:IsA("TextButton") then
createTween(frame, {Size = defaultSize}, interfaceTweenInfo):Play()
createTween(frame, {BackgroundColor3 = defaultColor}, interfaceTweenInfo):Play()
local button = frame:FindFirstChildWhichIsA("TextButton")
if button then
createTween(button, {TextColor3 = defaultTxtColor}, interfaceTweenInfo):Play()
end
end
end
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") or frame:IsA("TextButton") then
local defaultSize = frame.Size
local defaultColor = frame.BackgroundColor3
local defaultTxtColor = PlayButton.TextColor3
frame.MouseEnter:Connect(function()
onMouseEnter(frame)
end)
frame.MouseLeave:Connect(function()
onMouseLeave(frame, defaultSize, defaultColor, defaultTxtColor)
end)
end
end
PlayButton.MouseButton1Click:Connect(function()
GUI.Enabled = not GUI.Enabled
local tween = createTween(blur, {Size = 0}, blurTweenInfo)
tween.Completed:Connect(function()
blur.Enabled = false
end)
blur.Enabled = true
tween:Play()
end)
SettingsButton.MouseButton1Click:Connect(function()
if SettingsMenu.Visible then
createTween(SettingsMenu, {Size = UDim2.new(0, 0, 0, 0)}, interfaceTweenInfo):Play()
SettingsMenu.Visible = false
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") and frame ~= SettingsMenu then
createTween(frame, {Size = UDim2.new(1, 0, 1, 0)}, interfaceTweenInfo):Play()
for _, child in ipairs(frame:GetChildren()) do
if child:IsA("TextButton") then
child.Visible = true -- Показываем текстовые кнопки
end
end
end
end
else
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") and frame ~= SettingsMenu then
createTween(frame, {Size = UDim2.new(0, 0, 0, 0)}, interfaceTweenInfo):Play()
for _, child in ipairs(frame:GetChildren()) do
if child:IsA("TextButton") then
child.Visible = false -- Скрываем текстовые кнопки
end
end
end
end
SettingsMenu.Visible = true
createTween(SettingsMenu, {Size = UDim2.new(0.5, 0, 0.5, 0)}, interfaceTweenInfo):Play()
end
end)
Вот сам код. А проблема такая: когда я нажимаю на Settings(SettingsButton) у меня размер самого фрейма settings неестественный. не такой, каким я его выставлял в самой игре... попросил помочь нейросеть называется... вот видео:
local Lighting = game:GetService("Lighting")
local blur = Lighting.MainGuiBlur
local GUI = script.Parent
local title = GUI.Title
local buttons = GUI.Buttons
local PlayFrame = buttons.APlayFrame
local SettingsFrame = buttons.BSettingsFrame
local ShopFrame = buttons.CShopFrame
local CreditsFrame = buttons.DCreditsFrame
local SettingsMenu = GUI.SettingsMenu -- Меню настроек
local PlayButton = PlayFrame.Play
local SettingsButton = SettingsFrame.Settings
local ShopButton = ShopFrame.Shop
local CreditsButton = CreditsFrame.Credits
blur.Enabled = true
SettingsMenu.Size = UDim2.new(0, 0, 0, 0)
SettingsMenu.Visible = false
local interfaceTweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local blurTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local function createTween(target, goal, tweenInfo)
return TweenService:Create(target, tweenInfo, goal)
end
local function onMouseEnter(frame)
if frame:IsA("Frame") or frame:IsA("TextButton") then
local originalSize = frame.Size
local newSize = UDim2.new(originalSize.X.Scale * 1.1, originalSize.X.Offset * 1.1, originalSize.Y.Scale * 1.1, originalSize.Y.Offset * 1.1)
createTween(frame, {Size = newSize}, interfaceTweenInfo):Play()
createTween(frame, {BackgroundColor3 = Color3.new(0.245902, 0.245902, 0.245902)}, interfaceTweenInfo):Play()
local button = frame:FindFirstChildWhichIsA("TextButton")
if button then
createTween(button, {TextColor3 = Color3.fromRGB(239, 196, 40)}, interfaceTweenInfo):Play()
end
end
end
local function onMouseLeave(frame, defaultSize, defaultColor, defaultTxtColor)
if frame:IsA("Frame") or frame:IsA("TextButton") then
createTween(frame, {Size = defaultSize}, interfaceTweenInfo):Play()
createTween(frame, {BackgroundColor3 = defaultColor}, interfaceTweenInfo):Play()
local button = frame:FindFirstChildWhichIsA("TextButton")
if button then
createTween(button, {TextColor3 = defaultTxtColor}, interfaceTweenInfo):Play()
end
end
end
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") or frame:IsA("TextButton") then
local defaultSize = frame.Size
local defaultColor = frame.BackgroundColor3
local defaultTxtColor = PlayButton.TextColor3
frame.MouseEnter:Connect(function()
onMouseEnter(frame)
end)
frame.MouseLeave:Connect(function()
onMouseLeave(frame, defaultSize, defaultColor, defaultTxtColor)
end)
end
end
PlayButton.MouseButton1Click:Connect(function()
GUI.Enabled = not GUI.Enabled
local tween = createTween(blur, {Size = 0}, blurTweenInfo)
tween.Completed:Connect(function()
blur.Enabled = false
end)
blur.Enabled = true
tween:Play()
end)
SettingsButton.MouseButton1Click:Connect(function()
if SettingsMenu.Visible then
createTween(SettingsMenu, {Size = UDim2.new(0, 0, 0, 0)}, interfaceTweenInfo):Play()
SettingsMenu.Visible = false
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") and frame ~= SettingsMenu then
createTween(frame, {Size = UDim2.new(1, 0, 1, 0)}, interfaceTweenInfo):Play()
for _, child in ipairs(frame:GetChildren()) do
if child:IsA("TextButton") then
child.Visible = true -- Показываем текстовые кнопки
end
end
end
end
else
for _, frame in ipairs(buttons:GetChildren()) do
if frame:IsA("Frame") and frame ~= SettingsMenu then
createTween(frame, {Size = UDim2.new(0, 0, 0, 0)}, interfaceTweenInfo):Play()
for _, child in ipairs(frame:GetChildren()) do
if child:IsA("TextButton") then
child.Visible = false -- Скрываем текстовые кнопки
end
end
end
end
SettingsMenu.Visible = true
createTween(SettingsMenu, {Size = UDim2.new(0.5, 0, 0.5, 0)}, interfaceTweenInfo):Play()
end
end)
Вот сам код. А проблема такая: когда я нажимаю на Settings(SettingsButton) у меня размер самого фрейма settings неестественный. не такой, каким я его выставлял в самой игре... попросил помочь нейросеть называется... вот видео: