Character

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