PlayerGui
PlayerGui : Instance
Overview
PlayerGui๋ ํ๋ ์ด์ด๊ฐ ๊ฒ์์ ์ ์ํ ๋ ์๋์ผ๋ก ์์ฑ๋๋ ํด๋ผ์ด์ธํธ ์ ์ฉ ์ปจํ ์ด๋๋ก, Players ์๋น์ค ๋ด ๊ฐ Player ์ธ์คํด์ค์ ํ์์ ์์นํ๋ฉฐ, ์ด ์ปจํ ์ด๋๋ UI๋ฅผ ํ๋ ์ด์ด์ ํ๋ฉด์ ํ์ํ๊ณ ํด๋ผ์ด์ธํธ ์ธก ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๊ธฐ ์ํ ๊ณต๊ฐ์ผ๋ก ์ฌ์ฉ๋ฉ๋๋ค.
ํ๋ ์ด์ด๊ฐ ๊ฒ์์ ์ ์ํ๋ฉด, StarterGui ์๋น์ค์ ๋ชจ๋ UI ์์๊ฐ PlayerGui๋ก ํ๋ฒ๋ง ๋ณต์ฌ๋ฉ๋๋ค.
์ด ์ปจํ ์ด๋์ ํฌํจ๋ LocalScript๋ ํด๋น ํ๋ ์ด์ด์ ํด๋ผ์ด์ธํธ์์ ์คํ๋ฉ๋๋ค.
ํ๋ ์ด์ด์ ํ๋ฉด์ ํ์๋๋ StarterGui๊ฐ ์๋ PlayerGui์ ๋ณต์ ๋์ด ํ์๋๋ฏ๋ก, ๊ฒ์ ์ค์ UI๋ฅผ ์ ์ดํ๋ ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด StarterGui๊ฐ ์๋ PlayerGui๋ฅผ ํตํด ์ ๊ทผํด์ผ ํฉ๋๋ค:
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer.PlayerGui
local ScreenGui = PlayerGui:WaitForChild("ScreenGui")
local TextLabel = ScreenGui:WaitForChild("TextLabel")
TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)Properties
Methods
Events
Last updated