Как сделать меню в Roblox Studio?
Автор: Луи - Roblox
Загружено: 2024-01-27
Просмотров: 195
Описание:
-- RU
-- INFO:
-- Что нужно создать - Само меню, кнопку активации меню, кнопку закрытия меню, эффект размытия.
-- Как создать нужные парраметры - В StarterGui добавляем ScreenGui, в ScreenGui добавляем Frame и настраиваем его как душе угодно.
- После в Frame добавляем TextLable и так же настраиваем. Добавляем в Frame ImageButton и настраиваем. Добавляем в ScreenGui Text
-- Button и настраиваем. После всего этого добавляем в Frame LocalScript и вставляем данный скрипт. Если вы сделали всё правильно
-- то всё должно работать! Если что то не работает напешите в коментариях.
-- YouTube: Луи - Roblox
-- Название видеоролика "Как сделать магазин в Roblox Studio"
-- Как работает скрипт: Когда мы нажимаем на кнопку появленя меню то проигрывается анимация под названием AnimationGui, а когда мы
-- нажимаем кнопку закрития меню то проигрывается анимация под названием AnimationGuiClose.
------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EN
-- INFO:
-- What you need to create - The menu itself, the menu activation button, the menu close button, the blur effect.
-- How to create the necessary parameters - Add ScreenGui to StarterGui, add Frame to ScreenGui and customize it as you like.
- After adding the Textlabel to the Frame, we also configure it. We add an ImageButton to the Frame and configure it. We add Text
-- Button to ScreenGui and configure it. After all this, add the Local Script to the Frame and insert this script. If you did everything right
-- then everything should work! If something doesn't work, write in the comments.
-- YouTube: Луи - Roblox
-- The title of the video "Как сделать магазин в Roblox Studio"
-- How the script works: When we click on the menu button, an animation called Animation Gui is played, and when we
-- press the close menu button, then an animation called AnimationGuiClose is played.
------------------------------------------------------------------------------------------------------------------------------------------------------------
local TweenService = game:GetService("TweenService")
local sh = script.Parent -- путь к объекту "the path to the object"
local blur = game.Lighting.Blur -- размытие "blur"
local butt = sh.Parent.TextButton -- кнопка открытия меню "menu opening button"
local buttClose = sh.ImageButton -- кнопка закрытия меню "the button to close the menu"
local anim = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0) -- анимация "animation"
function AnimationGui() -- функция появление анимации "animation appearance function"
sh.Visible = true
local an = TweenService:Create(sh, anim, {Transparency = 0.5}) -- появление меню "menu appearance"
local text = TweenService:Create(sh.TextLabel, anim, {TextTransparency = 0})
local blu = TweenService:Create(blur, anim, {Size = 24}) -- появление размытия "the appearance of a blur"
local but = TweenService:Create(butt, anim, {Transparency = 1}) -- исчезание кнопки открытия меню "The menu opening button disappears"
local butCls = TweenService:Create(buttClose, anim, {ImageTransparency = 0}) -- появление кнопки закрытия меню "the appearance of the menu close button"
an:Play() -- активатор анимации "animation activator"
text:Play()
blu:Play()
but:Play()
butCls:Play()
end
function AnimationGuiClose() -- функция исчезающей анимации "disappearing animation function"
local an = TweenService:Create(sh, anim, {Transparency = 1}) -- исчезание меню "menu disappearing"
local text = TweenService:Create(sh.TextLabel, anim, {TextTransparency = 1})
local blu = TweenService:Create(blur, anim, {Size = 0}) -- исчезание размытия "fade blur"
local but = TweenService:Create(butt, anim, {Transparency = 0}) -- появление кнопки открытия меню "the appearance of the menu opening button"
local butCls = TweenService:Create(buttClose, anim, {ImageTransparency = 1}) -- исчезание кнопки закрытия меню "The menu close button disappears"
an:Play() -- активатор анимации "animation activator"
text:Play()
blu:Play()
but:Play()
butCls:Play()
wait(1)
sh.Visible = false
end
butt.MouseButton1Click:Connect(function() -- вызов функции появления меню "calling the menu appearance function"
AnimationGui()
end)
buttClose.MouseButton1Click:Connect(function() -- вызов функции исчезания меню "calling the menu fade function"
AnimationGuiClose()
end)
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: