배우기
엔진 클래스
Humanoid

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


요약
메서드
AddAccessory(accessory: Instance):()
AddCustomStatus(status: string):boolean
사용되지 않음
AddStatus(status: Enum.Status):boolean
사용되지 않음
ApplyDescription(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
사용되지 않음
ApplyDescriptionAsync(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
ApplyDescriptionReset(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
사용되지 않음
ApplyDescriptionResetAsync(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
GetPlayingAnimationTracks():{any}
사용되지 않음
GetStatuses():{any}
사용되지 않음
HasCustomStatus(status: string):boolean
사용되지 않음
HasStatus(status: Enum.Status):boolean
사용되지 않음
LoadAnimation(animation: Animation):AnimationTrack
사용되지 않음
loadAnimation(animation: Animation):AnimationTrack
사용되지 않음
Move(moveDirection: Vector3,relativeToCamera: boolean):()
MoveTo(location: Vector3,part: Instance):()
PlayEmote(emoteName: string):boolean
사용되지 않음
RemoveCustomStatus(status: string):boolean
사용되지 않음
RemoveStatus(status: Enum.Status):boolean
사용되지 않음
TakeDamage(amount: number):()
takeDamage(amount: number):()
사용되지 않음
상속된 멤버
코드 샘플
걷는 카메라 봄블 효과
local RunService = game:GetService("RunService")
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local function updateBobbleEffect()
local now = tick()
if humanoid.MoveDirection.Magnitude > 0 then -- 캐릭터가 걷고 있나요?
local velocity = humanoid.RootPart.Velocity
local bobble_X = math.cos(now * 9) / 5
local bobble_Y = math.abs(math.sin(now * 12)) / 5
local bobble = Vector3.new(bobble_X, bobble_Y, 0) * math.min(1, velocity.Magnitude / humanoid.WalkSpeed)
humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, 0.25)
else
-- CameraOffset의 크기를 줄여서 원래 위치로 다시 돌아가게 합니다.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

API 참조
속성
AutoJumpEnabled
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.AutoJumpEnabled:boolean
코드 샘플
자동 점프 전환
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local button = script.Parent
local function update()
-- 버튼 텍스트 업데이트
if player.AutoJumpEnabled then
button.Text = "자동 점프가 켜져 있습니다"
else
button.Text = "자동 점프가 꺼져 있습니다"
end
-- 플레이어의 캐릭터에 속성을 반영합니다, 만약 그들이 있다면
if player.Character then
local human = player.Character:FindFirstChild("Humanoid")
if human then
human.AutoJumpEnabled = player.AutoJumpEnabled
end
end
end
local function onActivated()
-- 자동 점프 전환
player.AutoJumpEnabled = not player.AutoJumpEnabled
-- 다른 모든 것 업데이트
update()
end
button.Activated:Connect(onActivated)
update()

AutomaticScalingEnabled
병렬 읽기
기능: AvatarAppearance
Humanoid.AutomaticScalingEnabled:boolean

AutoRotate
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.AutoRotate:boolean
코드 샘플
자동 회전 버튼
local button = script.Parent
local enabled = true
local ON_COLOR = BrickColor.Green()
local OFF_COLOR = BrickColor.Red()
local function touchButton(humanoid)
if enabled then
enabled = false
button.BrickColor = OFF_COLOR
if humanoid.AutoRotate then
print(humanoid:GetFullName() .. "는 더 이상 자동 회전할 수 없습니다!")
humanoid.AutoRotate = false
else
print(humanoid:GetFullName() .. "는 이제 자동 회전할 수 있습니다!")
humanoid.AutoRotate = true
end
task.wait(1)
button.BrickColor = ON_COLOR
enabled = true
end
end
local function onTouched(hit)
local char = hit:FindFirstAncestorWhichIsA("Model")
if char then
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid then
touchButton(humanoid)
end
end
end
button.Touched:Connect(onTouched)
button.BrickColor = ON_COLOR

BreakJointsOnDeath
병렬 읽기
기능: AvatarBehavior
Humanoid.BreakJointsOnDeath:boolean

CameraOffset
병렬 읽기
기능: AvatarBehavior
Humanoid.CameraOffset:Vector3
코드 샘플
걷는 카메라 봄블 효과
local RunService = game:GetService("RunService")
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local function updateBobbleEffect()
local now = tick()
if humanoid.MoveDirection.Magnitude > 0 then -- 캐릭터가 걷고 있나요?
local velocity = humanoid.RootPart.Velocity
local bobble_X = math.cos(now * 9) / 5
local bobble_Y = math.abs(math.sin(now * 12)) / 5
local bobble = Vector3.new(bobble_X, bobble_Y, 0) * math.min(1, velocity.Magnitude / humanoid.WalkSpeed)
humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, 0.25)
else
-- CameraOffset의 크기를 줄여서 원래 위치로 다시 돌아가게 합니다.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

CollisionType
사용되지 않음

DisplayDistanceType
병렬 읽기
기능: AvatarAppearance
Humanoid.DisplayDistanceType:Enum.HumanoidDisplayDistanceType
코드 샘플
휴머노이드의 체력과 이름 표시
local humanoid = script.Parent
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer
humanoid.HealthDisplayDistance = 0
humanoid.NameDisplayDistance = 100

DisplayName
병렬 읽기
기능: AvatarAppearance
Humanoid.DisplayName:string

EvaluateStateMachine
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.EvaluateStateMachine:boolean

FloorMaterial
읽기 전용
복제되지 않음
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.FloorMaterial:Enum.Material

Health
복제되지 않음
병렬 읽기
기능: AvatarBehavior
Humanoid.Health:number

HealthDisplayDistance
병렬 읽기
기능: AvatarAppearance
Humanoid.HealthDisplayDistance:number

HealthDisplayType
병렬 읽기
기능: AvatarAppearance
Humanoid.HealthDisplayType:Enum.HumanoidHealthDisplayType

HipHeight
병렬 읽기
기능: AvatarAppearance
시뮬레이션 액세스
Humanoid.HipHeight:number

Jump
복제되지 않음
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.Jump:boolean

JumpHeight
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.JumpHeight:number

JumpPower
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.JumpPower:number

LeftLeg
사용되지 않음

MaxHealth
병렬 읽기
기능: AvatarBehavior
Humanoid.MaxHealth:number

maxHealth
사용되지 않음

MaxSlopeAngle
병렬 읽기
기능: AvatarBehavior
Humanoid.MaxSlopeAngle:number
코드 샘플
휴머노이드가 올라갈 수 있는 경사의 제한
local player = game.Players.LocalPlayer
local char = player.CharacterAdded:wait()
local h = char:FindFirstChild("Humanoid")
h.MaxSlopeAngle = 30

MoveDirection
읽기 전용
복제되지 않음
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.MoveDirection:Vector3
코드 샘플
걷는 카메라 봄블 효과
local RunService = game:GetService("RunService")
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local function updateBobbleEffect()
local now = tick()
if humanoid.MoveDirection.Magnitude > 0 then -- 캐릭터가 걷고 있나요?
local velocity = humanoid.RootPart.Velocity
local bobble_X = math.cos(now * 9) / 5
local bobble_Y = math.abs(math.sin(now * 12)) / 5
local bobble = Vector3.new(bobble_X, bobble_Y, 0) * math.min(1, velocity.Magnitude / humanoid.WalkSpeed)
humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, 0.25)
else
-- CameraOffset의 크기를 줄여서 원래 위치로 다시 돌아가게 합니다.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

NameDisplayDistance
병렬 읽기
기능: AvatarAppearance
Humanoid.NameDisplayDistance:number

NameOcclusion
병렬 읽기
기능: AvatarAppearance
Humanoid.NameOcclusion:Enum.NameOcclusion
코드 샘플
플레이어 이름 숨기기
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.NamOcclusion = Enum.NameOcclusion.OccludeAll
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)

PlatformStand
병렬 읽기
기능: AvatarBehavior
Humanoid.PlatformStand:boolean

RequiresNeck
병렬 읽기
기능: AvatarBehavior
Humanoid.RequiresNeck:boolean

RightLeg
사용되지 않음

RigType
병렬 읽기
기능: AvatarAppearance
Humanoid.RigType:Enum.HumanoidRigType

RootPart
읽기 전용
복제되지 않음
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.RootPart:BasePart

SeatPart
읽기 전용
복제되지 않음
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.SeatPart:BasePart

Sit
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.Sit:boolean

TargetPoint
병렬 읽기
기능: AvatarBehavior
Humanoid.TargetPoint:Vector3

Torso
사용되지 않음

UseJumpPower
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.UseJumpPower:boolean

WalkSpeed
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.WalkSpeed:number

WalkToPart
병렬 읽기
기능: AvatarBehavior
Humanoid.WalkToPart:BasePart

WalkToPoint
병렬 읽기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid.WalkToPoint:Vector3

메서드
AddAccessory
기능: AvatarAppearance
Humanoid:AddAccessory(accessory:Instance):()
매개 변수
accessory:Instance
반환
()
코드 샘플
[휴머노이드] 액세서리 추가 예제
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local clockworksShades = Instance.new("Accessory")
clockworksShades.Name = "ClockworksShades"
local handle = Instance.new("Part")
handle.Name = "Handle"
handle.Size = Vector3.new(1, 1.6, 1)
handle.Parent = clockworksShades
local faceFrontAttachment = Instance.new("Attachment")
faceFrontAttachment.Name = "FaceFrontAttachment"
faceFrontAttachment.Position = Vector3.new(0, -0.24, -0.45)
faceFrontAttachment.Parent = handle
local mesh = Instance.new("SpecialMesh")
mesh.Name = "Mesh"
mesh.Scale = Vector3.new(1, 1.3, 1)
mesh.MeshId = "rbxassetid://1577360"
mesh.TextureId = "rbxassetid://1577349"
mesh.Parent = handle
humanoid:AddAccessory(clockworksShades)

AddCustomStatus
사용되지 않음

AddStatus
사용되지 않음

ApplyDescription
사용되지 않음

ApplyDescriptionAsync
생성
기능: AvatarAppearance
Humanoid:ApplyDescriptionAsync(
humanoidDescription:HumanoidDescription, assetTypeVerification:Enum.AssetTypeVerification
):()
매개 변수
humanoidDescription:HumanoidDescription
assetTypeVerification:Enum.AssetTypeVerification
기본값: "Default"
반환
()

ApplyDescriptionReset
사용되지 않음

ApplyDescriptionResetAsync
생성
기능: AvatarAppearance
Humanoid:ApplyDescriptionResetAsync(
humanoidDescription:HumanoidDescription, assetTypeVerification:Enum.AssetTypeVerification
):()
매개 변수
humanoidDescription:HumanoidDescription
assetTypeVerification:Enum.AssetTypeVerification
기본값: "Default"
반환
()

BuildRigFromAttachments
기능: AvatarBehavior
Humanoid:BuildRigFromAttachments():()
반환
()
코드 샘플
부착물에서 리그 구축의 Lua 포트
local function createJoint(jointName, att0, att1)
local partForJoint = att1.Parent
while partForJoint and not partForJoint:IsA("BasePart") do
partForJoint = partForJoint.Parent
end
local oldJoint = partForJoint:FindFirstChild(jointName)
if oldJoint and oldJoint:IsA("AnimationConstraint") then
oldJoint.Attachment0 = att0
oldJoint.Attachment1 = att1
oldJoint.Parent = partForJoint
else
local ac = Instance.new("AnimationConstraint")
ac.Name = jointName
ac.IsKinematic = true
ac.Attachment0 = att0
ac.Attachment1 = att1
ac.Parent = partForJoint
end
end
local function collectRigAttachments(part)
local rigAttachments = {}
for _, child in pairs(part:GetChildren()) do
if child:IsA("Attachment") and child.Name:find("RigAttachment$") then
rigAttachments[child.Name] = child
end
end
-- 뼈대는 부품 수준의 RigAttachments를 재정의하는 더 깊은 RigAttachments를 포함할 수 있습니다.
-- (R15+ 확장된 스켈레톤).
for _, child in pairs(part:GetChildren()) do
if child:IsA("Bone") then
for _, descendant in pairs(child:GetDescendants()) do
if descendant:IsA("Attachment") and descendant.Name:find("RigAttachment$") then
rigAttachments[descendant.Name] = descendant
end
end
end
end
return rigAttachments
end
local function buildJointsFromAttachments(part, characterParts, visitedParts)
if not part or visitedParts[part] then
return
end
visitedParts[part] = true
local rigAttachments = collectRigAttachments(part)
for attachmentName, attachment in pairs(rigAttachments) do
local jointName = attachmentName:sub(1, #attachmentName - #"RigAttachment")
if not part:FindFirstChild(jointName) then
for _, characterPart in pairs(characterParts) do
if not visitedParts[characterPart] then
local matchingAttachment = characterPart:FindFirstChild(attachmentName)
if matchingAttachment and matchingAttachment:IsA("Attachment") then
createJoint(jointName, attachment, matchingAttachment)
buildJointsFromAttachments(characterPart, characterParts, visitedParts)
break
end
end
end
end
end
end
local function buildRigFromAttachments(humanoid)
local rootPart = humanoid.RootPart
assert(rootPart, "Humanoid는 HumanoidRootPart가 없습니다.")
local characterParts = {}
for _, descendant in ipairs(humanoid.Parent:GetDescendants()) do
if descendant:IsA("BasePart") then
table.insert(characterParts, descendant)
end
end
local visitedParts = {}
buildJointsFromAttachments(rootPart, characterParts, visitedParts)
end
local humanoid = script.Parent:WaitForChild("Humanoid")
buildRigFromAttachments(humanoid)
R15 패키지 가져오기
local AssetService = game:GetService("AssetService")
local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")
local PACKAGE_ASSET_ID = 193700907 -- 회로 차단기
local function addAttachment(part, name, position, orientation)
local attachment = Instance.new("Attachment")
attachment.Name = name
attachment.Parent = part
if position then
attachment.Position = position
end
if orientation then
attachment.Orientation = orientation
end
return attachment
end
local function createBaseCharacter()
local character = Instance.new("Model")
local humanoid = Instance.new("Humanoid")
humanoid.Parent = character
local rootPart = Instance.new("Part")
rootPart.Name = "HumanoidRootPart"
rootPart.Size = Vector3.new(2, 2, 1)
rootPart.Transparency = 1
rootPart.Parent = character
addAttachment(rootPart, "RootRigAttachment")
local head = Instance.new("Part")
head.Name = "Head"
head.Size = Vector3.new(2, 1, 1)
head.Parent = character
local headMesh = Instance.new("SpecialMesh")
headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
headMesh.MeshType = Enum.MeshType.Head
headMesh.Parent = head
local face = Instance.new("Decal")
face.Name = "face"
face.Texture = "rbxasset://textures/face.png"
face.Parent = head
addAttachment(head, "FaceCenterAttachment")
addAttachment(head, "FaceFrontAttachment", Vector3.new(0, 0, -0.6))
addAttachment(head, "HairAttachment", Vector3.new(0, 0.6, 0))
addAttachment(head, "HatAttachment", Vector3.new(0, 0.6, 0))
addAttachment(head, "NeckRigAttachment", Vector3.new(0, -0.5, 0))
return character, humanoid
end
local function createR15Package(packageAssetId)
local packageAssetInfo = MarketplaceService:GetProductInfoAsync(packageAssetId)
local character, humanoid = createBaseCharacter()
character.Name = packageAssetInfo.Name
local assetIds = AssetService:GetAssetIdsForPackageAsync(packageAssetId)
for _, assetId in pairs(assetIds) do
local limb = InsertService:LoadAsset(assetId)
local r15 = limb:FindFirstChild("R15")
if r15 then
for _, part in pairs(r15:GetChildren()) do
part.Parent = character
end
else
for _, child in pairs(limb:GetChildren()) do
child.Parent = character
end
end
end
humanoid:BuildRigFromAttachments()
return character
end
local r15Package = createR15Package(PACKAGE_ASSET_ID)
r15Package.Parent = workspace

ChangeState
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:ChangeState(state:Enum.HumanoidStateType):()
매개 변수
기본값: "None"
반환
()
코드 샘플
더블 점프
local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local doubleJumpEnabled = false
humanoid.StateChanged:Connect(function(_oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not doubleJumpEnabled then
task.wait(0.2)
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
doubleJumpEnabled = true
end
end
elseif newState == Enum.HumanoidStateType.Landed then
doubleJumpEnabled = false
end
end)
UserInputService.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.Space then
if doubleJumpEnabled then
if humanoid:GetState() ~= Enum.HumanoidStateType.Jumping then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
task.spawn(function()
doubleJumpEnabled = false
end)
end
end
end
end)

EquipTool
기능: AvatarBehavior
Humanoid:EquipTool(tool:Instance):()
매개 변수
반환
()

GetAccessories
기능: AvatarAppearance
Humanoid:GetAccessories():{any}
반환
코드 샘플
로드 후 액세서리 제거
local Players = game:GetService("Players")
local function onPlayerAddedAsync(player)
local connection = player.CharacterAppearanceLoaded:Connect(function(character)
-- 이 시점에서 모든 액세서리가 로드되었습니다
local humanoid = character:FindFirstChildOfClass("Humanoid")
local numAccessories = #humanoid:GetAccessories()
print(("%s의 %d 개 액세서리를 제거합니다."):format(player.Name, numAccessories))
humanoid:RemoveAccessories()
end)
-- 플레이어가 나간 후 연결을 끊기 위해 우리의 연결을 확인하십시오
-- 플레이어가 가비지 수집되도록 허용합니다
player.AncestryChanged:Wait()
connection:Disconnect()
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAddedAsync, player)
end
Players.PlayerAdded:Connect(onPlayerAddedAsync)

GetAppliedDescription
기능: AvatarAppearance
Humanoid:GetAppliedDescription():HumanoidDescription

GetBodyPartR15
기능: AvatarBehavior
Humanoid:GetBodyPartR15(part:Instance):Enum.BodyPartR15
매개 변수

GetLimb
기능: AvatarBehavior
Humanoid:GetLimb(part:Instance):Enum.Limb
매개 변수
반환
코드 샘플
휴머노이드의 사지 가져오기
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
for _, child in pairs(character:GetChildren()) do
local limb = humanoid:GetLimb(child)
if limb ~= Enum.Limb.Unknown then
print(child.Name .. "는 사지 " .. limb.Name .. "의 일부입니다.")
end
end

GetMoveVelocity
기능: AvatarBehavior
Humanoid:GetMoveVelocity():Vector3
반환

GetPlayingAnimationTracks
사용되지 않음

GetRelativeVelocityAtFloor
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:GetRelativeVelocityAtFloor():Vector3
반환

GetState
병렬 쓰기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:GetState():Enum.HumanoidStateType
코드 샘플
더블 점프
local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local doubleJumpEnabled = false
humanoid.StateChanged:Connect(function(_oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not doubleJumpEnabled then
task.wait(0.2)
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
doubleJumpEnabled = true
end
end
elseif newState == Enum.HumanoidStateType.Landed then
doubleJumpEnabled = false
end
end)
UserInputService.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.Space then
if doubleJumpEnabled then
if humanoid:GetState() ~= Enum.HumanoidStateType.Jumping then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
task.spawn(function()
doubleJumpEnabled = false
end)
end
end
end
end)

GetStateEnabled
병렬 쓰기
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:GetStateEnabled(state:Enum.HumanoidStateType):boolean
매개 변수
반환
코드 샘플
휴머노이드 상태 설정 및 가져오기
local humanoid = script.Parent:WaitForChild("Humanoid")
-- 상태 설정
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
-- 상태 가져오기
print(humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping)) -- false

GetStatuses
사용되지 않음

HasCustomStatus
사용되지 않음

HasStatus
사용되지 않음

LoadAnimation
사용되지 않음

loadAnimation
사용되지 않음

Move
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:Move(
moveDirection:Vector3, relativeToCamera:boolean
):()
매개 변수
moveDirection:Vector3
relativeToCamera:boolean
기본값: false
반환
()
코드 샘플
유형을 앞으로 이동
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
RunService:BindToRenderStep("move", Enum.RenderPriority.Character.Value + 1, function()
if player.Character then
local humanoid = player.Character:FindFirstChild("Humanoid")
if humanoid then
humanoid:Move(Vector3.new(0, 0, -1), true)
end
end
end)

MoveTo
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:MoveTo(
location:Vector3, part:Instance
):()
매개 변수
location:Vector3
기본값: "nil"
반환
()
코드 샘플
휴머노이드 MoveTo 타임아웃 없이
local function moveTo(humanoid, targetPoint, andThen)
local targetReached = false
-- 휴머노이드가 목표에 도달하는지 듣기
local connection
connection = humanoid.MoveToFinished:Connect(function(reached)
targetReached = true
connection:Disconnect()
connection = nil
if andThen then
andThen(reached)
end
end)
-- 걷기 시작
humanoid:MoveTo(targetPoint)
-- 함수가 yield되지 않도록 새로운 스레드에서 실행
task.spawn(function()
while not targetReached do
-- 휴머노이드가 여전히 존재하는가?
if not (humanoid and humanoid.Parent) then
break
end
-- 목표가 변경되었는가?
if humanoid.WalkToPoint ~= targetPoint then
break
end
-- 타임아웃 새로 고치기
humanoid:MoveTo(targetPoint)
task.wait(6)
end
-- 여전히 연결되어 있는 경우 연결 끊기
if connection then
connection:Disconnect()
connection = nil
end
end)
end
local function andThen(reached)
print((reached and "목적지에 도달했습니다!") or "목적지에 도달하지 못했습니다!")
end
moveTo(script.Parent:WaitForChild("Humanoid"), Vector3.new(50, 0, 50), andThen)

PlayEmote
사용되지 않음

PlayEmoteAsync
생성
기능: AvatarBehavior
Humanoid:PlayEmoteAsync(emoteName:string):boolean
매개 변수
emoteName:string
반환

RemoveAccessories
기능: AvatarAppearance
Humanoid:RemoveAccessories():()
반환
()
코드 샘플
로드 후 액세서리 제거
local Players = game:GetService("Players")
local function onPlayerAddedAsync(player)
local connection = player.CharacterAppearanceLoaded:Connect(function(character)
-- 이 시점에서 모든 액세서리가 로드되었습니다
local humanoid = character:FindFirstChildOfClass("Humanoid")
local numAccessories = #humanoid:GetAccessories()
print(("%s의 %d 개 액세서리를 제거합니다."):format(player.Name, numAccessories))
humanoid:RemoveAccessories()
end)
-- 플레이어가 나간 후 연결을 끊기 위해 우리의 연결을 확인하십시오
-- 플레이어가 가비지 수집되도록 허용합니다
player.AncestryChanged:Wait()
connection:Disconnect()
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAddedAsync, player)
end
Players.PlayerAdded:Connect(onPlayerAddedAsync)

RemoveCustomStatus
사용되지 않음

RemoveStatus
사용되지 않음

ReplaceBodyPartR15
기능: AvatarAppearance
Humanoid:ReplaceBodyPartR15(
bodyPart:Enum.BodyPartR15, part:BasePart
매개 변수
반환

SetStateEnabled
기능: AvatarBehavior
시뮬레이션 액세스
Humanoid:SetStateEnabled(
):()
매개 변수
enabled:boolean
반환
()
코드 샘플
점프 쿨다운
local character = script.Parent
local JUMP_DEBOUNCE = 1
local humanoid = character:WaitForChild("Humanoid")
local isJumping = false
humanoid.StateChanged:Connect(function(_oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not isJumping then
isJumping = true
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
end
elseif newState == Enum.HumanoidStateType.Landed then
if isJumping then
isJumping = false
task.wait(JUMP_DEBOUNCE)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
end
end
end)

TakeDamage
기능: AvatarBehavior
Humanoid:TakeDamage(amount:number):()
매개 변수
amount:number
반환
()
코드 샘플
인간형 피해주기
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid:TakeDamage(99)

takeDamage
사용되지 않음

UnequipTools
기능: AvatarBehavior
Humanoid:UnequipTools():()
반환
()

이벤트
AnimationPlayed
사용되지 않음

ApplyDescriptionFinished
기능: AvatarAppearance
Humanoid.ApplyDescriptionFinished(description:HumanoidDescription):RBXScriptSignal
매개 변수

Climbing
기능: AvatarBehavior
Humanoid.Climbing(speed:number):RBXScriptSignal
매개 변수
speed:number
코드 샘플
휴머노이드.클라이밍
local Players = game:GetService("Players")
local function onCharacterClimbing(character, speed)
print(character.Name, "가", speed, "스텀 / 초로 클라이밍 중입니다.")
end
local function onCharacterAdded(character)
character.Humanoid.Climbing:Connect(function(speed)
onCharacterClimbing(character, speed)
end)
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)

CustomStatusAdded
사용되지 않음

CustomStatusRemoved
사용되지 않음

Died
기능: AvatarBehavior
Humanoid.Died():RBXScriptSignal
코드 샘플
휴머노이드.사망
local Players = game:GetService("Players")
local function onPlayerAdded(player)
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local function onDied()
print(player.Name, "사망했습니다!")
end
humanoid.Died:Connect(onDied)
end
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)

FallingDown
기능: AvatarBehavior
Humanoid.FallingDown(active:boolean):RBXScriptSignal
매개 변수
active:boolean

FreeFalling
기능: AvatarBehavior
Humanoid.FreeFalling(active:boolean):RBXScriptSignal
매개 변수
active:boolean

GettingUp
기능: AvatarBehavior
Humanoid.GettingUp(active:boolean):RBXScriptSignal
매개 변수
active:boolean

HealthChanged
기능: AvatarBehavior
Humanoid.HealthChanged(health:number):RBXScriptSignal
매개 변수
health:number
코드 샘플
휴머노이드.건강변경
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local currentHealth = humanoid.Health
local function onHealthChanged(health)
local change = math.abs(currentHealth - health)
print("휴머노이드의 건강이", (currentHealth > health and "감소했습니다" or "증가했습니다"), change)
currentHealth = health
end
humanoid.HealthChanged:Connect(onHealthChanged)
end
player.CharacterAdded:Connect(onCharacterAdded)
체력 바
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- 스크립트를 프레임 내의 프레임에
-- 부모가 된 LocalScript에 붙여넣으세요
local frame = script.Parent
local container = frame.Parent
container.BackgroundColor3 = Color3.new(0, 0, 0) -- 검정색
-- 이 함수는 인간의 체력이 변경될 때 호출됩니다
local function onHealthChanged()
local human = player.Character.Humanoid
local percent = human.Health / human.MaxHealth
-- 내부 바의 크기를 변경합니다
frame.Size = UDim2.new(percent, 0, 1, 0)
-- 체력 바의 색상을 변경합니다
if percent < 0.1 then
frame.BackgroundColor3 = Color3.new(1, 0, 0) -- 검정색
elseif percent < 0.4 then
frame.BackgroundColor3 = Color3.new(1, 1, 0) -- 노란색
else
frame.BackgroundColor3 = Color3.new(0, 1, 0) -- 초록색
end
end
-- 이 함수는 플레이어가 스폰될 때 호출됩니다
local function onCharacterAdded(character)
local human = character:WaitForChild("Humanoid")
-- 패턴: 지금 한 번 업데이트한 후 체력이 변경될 때마다
human.HealthChanged:Connect(onHealthChanged)
onHealthChanged()
end
-- 우리의 스폰 리스너를 연결합니다; 이미 스폰된 경우 호출합니다
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end

Jumping
기능: AvatarBehavior
Humanoid.Jumping(active:boolean):RBXScriptSignal
매개 변수
active:boolean

MoveToFinished
기능: AvatarBehavior
Humanoid.MoveToFinished(reached:boolean):RBXScriptSignal
매개 변수
reached:boolean
코드 샘플
휴머노이드 MoveTo 타임아웃 없이
local function moveTo(humanoid, targetPoint, andThen)
local targetReached = false
-- 휴머노이드가 목표에 도달하는지 듣기
local connection
connection = humanoid.MoveToFinished:Connect(function(reached)
targetReached = true
connection:Disconnect()
connection = nil
if andThen then
andThen(reached)
end
end)
-- 걷기 시작
humanoid:MoveTo(targetPoint)
-- 함수가 yield되지 않도록 새로운 스레드에서 실행
task.spawn(function()
while not targetReached do
-- 휴머노이드가 여전히 존재하는가?
if not (humanoid and humanoid.Parent) then
break
end
-- 목표가 변경되었는가?
if humanoid.WalkToPoint ~= targetPoint then
break
end
-- 타임아웃 새로 고치기
humanoid:MoveTo(targetPoint)
task.wait(6)
end
-- 여전히 연결되어 있는 경우 연결 끊기
if connection then
connection:Disconnect()
connection = nil
end
end)
end
local function andThen(reached)
print((reached and "목적지에 도달했습니다!") or "목적지에 도달하지 못했습니다!")
end
moveTo(script.Parent:WaitForChild("Humanoid"), Vector3.new(50, 0, 50), andThen)

PlatformStanding
기능: AvatarBehavior
Humanoid.PlatformStanding(active:boolean):RBXScriptSignal
매개 변수
active:boolean

Ragdoll
기능: AvatarBehavior
Humanoid.Ragdoll(active:boolean):RBXScriptSignal
매개 변수
active:boolean

Running
기능: AvatarBehavior
Humanoid.Running(speed:number):RBXScriptSignal
매개 변수
speed:number
코드 샘플
휴머노이드 달리기
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local function onRunning(speed: number)
if speed > 0 then
print(`{localPlayer.Name}가 달리고 있습니다`)
else
print(`{localPlayer.Name}가 멈췄습니다`)
end
end
humanoid.Running:Connect(function(speed: number)
onRunning(speed)
end)

Seated
기능: AvatarBehavior
Humanoid.Seated(
active:boolean, currentSeatPart:BasePart
매개 변수
active:boolean
currentSeatPart:BasePart
코드 샘플
플레이어의 좌석 찾기
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local function onSeated(isSeated, seat)
if isSeated then
print("나는 이제 앉아 있습니다: " .. seat.Name .. "!")
else
print("나는 아무것도 안 앉아 있습니다")
end
end
humanoid.Seated:Connect(onSeated)

StateChanged
기능: AvatarBehavior
코드 샘플
점프하는 입자
local character = script.Parent
local primaryPart = character.PrimaryPart
-- 입자 생성
local particles = Instance.new("ParticleEmitter")
particles.Size = NumberSequence.new(1)
particles.Transparency = NumberSequence.new(0, 1)
particles.Acceleration = Vector3.new(0, -10, 0)
particles.Lifetime = NumberRange.new(1)
particles.Rate = 20
particles.EmissionDirection = Enum.NormalId.Back
particles.Enabled = false
particles.Parent = primaryPart
local humanoid = character:WaitForChild("Humanoid")
local isJumping = false
-- 휴머노이드 상태 수신
local function onStateChanged(_oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not isJumping then
isJumping = true
particles.Enabled = true
end
elseif newState == Enum.HumanoidStateType.Landed then
if isJumping then
isJumping = false
particles.Enabled = false
end
end
end
humanoid.StateChanged:Connect(onStateChanged)
점프 쿨다운
local character = script.Parent
local JUMP_DEBOUNCE = 1
local humanoid = character:WaitForChild("Humanoid")
local isJumping = false
humanoid.StateChanged:Connect(function(_oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if not isJumping then
isJumping = true
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
end
elseif newState == Enum.HumanoidStateType.Landed then
if isJumping then
isJumping = false
task.wait(JUMP_DEBOUNCE)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
end
end
end)

StateEnabledChanged
기능: AvatarBehavior
Humanoid.StateEnabledChanged(
매개 변수
isEnabled:boolean
코드 샘플
휴머노이드 상태 변화 감지기
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local function onStateEnabledChanged(state, enabled)
if enabled then
print(state.Name .. " 가 활성화되었습니다")
else
print(state.Name .. " 가 비활성화되었습니다")
end
end
humanoid.StateEnabledChanged:Connect(onStateEnabledChanged)

StatusAdded
사용되지 않음

StatusRemoved
사용되지 않음

Strafing
기능: AvatarBehavior
Humanoid.Strafing(active:boolean):RBXScriptSignal
매개 변수
active:boolean

Swimming
기능: AvatarBehavior
Humanoid.Swimming(speed:number):RBXScriptSignal
매개 변수
speed:number

Touched
기능: AvatarBehavior
Humanoid.Touched(
touchingPart:BasePart, humanoidPart:BasePart
매개 변수
touchingPart:BasePart
humanoidPart:BasePart
코드 샘플
미다스의 손
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local partInfo = {}
local debounce = false
local function onHumanoidTouched(hit, _limb)
if debounce then
return
end
if not hit.CanCollide or hit.Transparency ~= 0 then
return
end
if not partInfo[hit] then
partInfo[hit] = {
BrickColor = hit.BrickColor,
Material = hit.Material,
}
hit.BrickColor = BrickColor.new("Gold")
hit.Material = Enum.Material.Ice
debounce = true
task.wait(0.2)
debounce = false
end
end
local touchedConnection = humanoid.Touched:Connect(onHumanoidTouched)
local function onHumanoidDied()
if touchedConnection then
touchedConnection:Disconnect()
end
-- 모든 금을 되돌리기
for part, info in pairs(partInfo) do
if part and part.Parent then
part.BrickColor = info.BrickColor
part.Material = info.Material
end
end
end
humanoid.Died:Connect(onHumanoidDied)

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.