Character
ν΄λΌμ΄μΈνΈμμ μ¬μ©λλ μΊλ¦ν°μ λν κ°μ²΄μμ.
ν¨μ
ν΄λΉ μΊλ¦ν°μ νλ μ΄μ΄λ₯Ό μ»μ μ μμ΄μ.
-- μν --
local player = character:GetPlayer() --μΊλ¦ν°μ νλ μ΄μ΄λ₯Ό λ°νν΄μ.
νλ μ΄μ΄μ μμ΄λλ₯Ό μ»μ μ μμ΄μ.
-- μν --
print(character:GetPlayerID()) --μΊλ¦ν°μ νλ μ΄μ΄ μμ΄λλ₯Ό μ«μλ‘ λ°νν΄μ.
νλ μ΄μ΄μ λλ€μμ μ»μ μ μμ΄μ.
-- μν --
print(character:GetPlayerNickName()) --μΊλ¦ν°μ νλ μ΄μ΄ λλ€μμ λ¬Έμμ΄λ‘ λ°νν΄μ.
μΊλ¦ν° νΉμ μμΉμ FXλ₯Ό μμ±ν μ μμ΄μ. (μμ± νκ³ μΆμ FX μ€λΈμ νΈ, Enum.BoneType.νμ
)
-- μν --
character:CreateFX(Workspace.Effect, Enum.Bone.Body) --μΊλ¦ν°μ νΉμ λΆμμ μ΄ννΈλ₯Ό μμ±ν΄μ.
μΊλ¦ν°μ μμΉμ Soundλ₯Ό μμ±ν μ μμ΄μ. (μμ± νκ³ μΆμ Sound μ€λΈμ νΈ)
-- μν --
character:CreateSound(Workspace.Sound)
UI HUDλ₯Ό λΆμΌ μ μμ΄μ. (λΆν μ§ UI μ΄λ¦, λΆμΌ UI Screen, Enum.UIDisplayType.νμ
)
-- μν --
local playerNameUI = HUD.PlayerNameUI
playerNameUI.Visible = false
local function spawn(character)
local ui = character:AddPlayerHUD("Name", playerNameUI, Enum.UIDisplayType.Billboard) --μΊλ¦ν°μ HUDλ₯Ό μΆκ°νκ³ μ΄λ¦μΌλ‘ λ±λ‘ν΄μ.
ui.Visible = true
end
Game.OnSpawnCharacter:Connect(spawn)
UI HUDλ₯Ό μ κ±°ν΄μ. (μ κ±°νκ³ μΆμ UI μ΄λ¦)
-- μν --
character:RemovePlayerHUD("Name") --μΊλ¦ν°μ μΆκ°λ HUDλ₯Ό μ΄λ¦μΌλ‘ μ°Ύμμ μμ ν΄μ.
νμ¬ μΊλ¦ν°μ λͺ¨λ UI HUDλ₯Ό μ κ±°ν΄μ.
-- μν --
character:RemovePlayerAllHUD() --μΊλ¦ν°μ μΆκ°λ λͺ¨λ HUDλ₯Ό μμ ν΄μ.
UI HUDλ₯Ό μ»μ μ μμ΄μ. (μ»κ³ μΆμ UI μ΄λ¦)
-- μν --
local playerNameUI = character:GetPlayerHUD("Name") --μΊλ¦ν°μ μΆκ°λ HUDλ₯Ό μ΄λ¦μΌλ‘ μ°Ύμμ λ°νν΄μ.
playerNameUI.Text:SetTextColor(Color.new(255, 0, 0, 255))
νλ μ΄μ΄ μμ μ μΊλ¦ν°μΈμ§ μλμ§ νμΈν μ μμ΄μ.
-- μν --
print(character:IsMyCharacter()) --μΊλ¦ν°κ° μμ μ μΊλ¦ν°μ΄λ©΄ trueλ₯Ό λ°νν΄μ.
μ¬μ© κ°λ₯ν λΆλͺ¨ μ€λΈμ νΈ κΈ°λ₯λ€
μμ±
μ΄λ²€νΈ
ν¨μ
Last updated