스타터GUI

스타터GUI는 Roblox에서 GUI(그래픽 사용자 인터페이스) 요소를 관리하는 서비스입니다. 게임에 참가하는 각 플레이어의 PlayerGui에 이 요소들이 복제됩니다.

스타터GUI에 배치된 스크립트는 보통 플레이어가 게임 도중 상호작용하는 버튼, 메뉴, 기타 인터페이스 요소를 제어합니다.

스타터GUI 예제

-- StarterGui > HealthGui > HealthScript

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local healthGui = script.Parent
local healthBar = healthGui:WaitForChild("Frame")
local healthLabel = healthBar:WaitForChild("TextLabel")

local function updateHealth()
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if humanoid then
        local healthPercent = humanoid.Health / humanoid.MaxHealth
        healthBar.Size = UDim2.new(healthPercent, 0, 1, 0)
        healthLabel.Text = math.ceil(humanoid.Health) .. " / " .. math.ceil(humanoid.MaxHealth)
    end
end

local humanoid = character:WaitForChild("Humanoid")
humanoid.HealthChanged:Connect(updateHealth)

updateHealth()
Image 1
Image 2
Roblox Studio

이 튜토리얼이 도움이 되셨다면, 저의 작업을 지원하기 위해 커피 한 잔을 사주시면 감사하겠습니다.

지원해 주셔서 정말 감사합니다!

커피 한 잔 사주기