Roblox UI 만드는 방법
발행: (2026년 1월 16일 오전 10:15 GMT+9)
3 min read
원문: Dev.to
Source: Dev.to
Step 1: UI 만들기
- Roblox Studio를 엽니다.
- Explorer에서 StarterGui로 이동합니다.
- ScreenGui를 삽입하고 이름을
MainMenuGui로 바꿉니다. MainMenuGui안에 Frame을 삽입하고 이름을MainFrame으로 바꿉니다.MainFrame안에 다음을 삽입합니다:Title이라는 이름의 TextLabel.PlayButton이라는 이름의 TextButton.
이 단계에서 Studio에서 Play를 누르면 메뉴가 표시됩니다.
UI 설정
MainFrame
- Size:
{1, 0}, {1, 0} - BackgroundColor3:
dark gray(또는 원하는 색상) - BorderSizePixel:
0
Title
- Text:
MY GAME - TextScaled:
true - Size:
{0.6, 0}, {0.2, 0} - Position:
{0.2, 0}, {0.15, 0} - BackgroundTransparency:
1
PlayButton
- Text:
PLAY - TextScaled:
true - Size:
{0.3, 0}, {0.12, 0} - Position:
{0.35, 0}, {0.5, 0}
Step 2: 메인 메뉴 스크립트
MainMenuGui안에 LocalScript를 삽입합니다.
Script code
local player = game.Players.LocalPlayer
local gui = script.Parent
local mainFrame = gui:WaitForChild("MainFrame")
local playButton = mainFrame:WaitForChild("PlayButton")
playButton.MouseButton1Click:Connect(function()
mainFrame.Visible = false
print("Game Started")
end)
이 스크립트가 작동하는 방식
- LocalScripts는 UI에 필요하므로 플레이어의 컴퓨터에서 실행됩니다.
script.Parent는ScreenGui를 가리킵니다.WaitForChild는 UI 요소가 접근되기 전에 존재함을 보장합니다.MouseButton1Click은 버튼이 클릭될 때 발생합니다.Visible을false로 설정하면 메뉴가 즉시 숨겨집니다.
특별한 트릭도, 마법도 없습니다.
Step 3: Play를 누를 때까지 플레이어 잠그기 (선택 사항)
플레이어가 Play를 클릭할 때까지 움직이지 못하게 하려면 다음 단계를 따르세요:
- StarterPlayer → StarterPlayerScripts로 이동합니다.
- LocalScript를 삽입합니다.
Script code
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
local gui = player.PlayerGui:WaitForChild("MainMenuGui")
local frame = gui:WaitForChild("MainFrame")
frame:GetPropertyChangedSignal("Visible"):Wait()
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
이 스크립트가 하는 일
- 플레이어가 스폰됩니다.
WalkSpeed와JumpPower를0으로 설정하여 이동을 비활성화합니다.- 스크립트는 메뉴 프레임이 보이지 않을 때까지 기다립니다.
- Play가 클릭되어 프레임이 숨겨지면 이동이 복구됩니다 (
WalkSpeed = 16,JumpPower = 50).
이는 매우 일반적인 Roblox 설정입니다.