Pelajari
Kelas Engine
Humanoid

*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.


Rangkuman
Metode
AddAccessory(accessory: Instance):()
AddCustomStatus(status: string):boolean
Tidak digunakan lagi
AddStatus(status: Enum.Status):boolean
Tidak digunakan lagi
ApplyDescription(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
Tidak digunakan lagi
ApplyDescriptionAsync(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
ApplyDescriptionReset(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
Tidak digunakan lagi
ApplyDescriptionResetAsync(humanoidDescription: HumanoidDescription,assetTypeVerification: Enum.AssetTypeVerification):()
GetPlayingAnimationTracks():{any}
Tidak digunakan lagi
GetStatuses():{any}
Tidak digunakan lagi
HasCustomStatus(status: string):boolean
Tidak digunakan lagi
HasStatus(status: Enum.Status):boolean
Tidak digunakan lagi
LoadAnimation(animation: Animation):AnimationTrack
Tidak digunakan lagi
loadAnimation(animation: Animation):AnimationTrack
Tidak digunakan lagi
Move(moveDirection: Vector3,relativeToCamera: boolean):()
MoveTo(location: Vector3,part: Instance):()
PlayEmote(emoteName: string):boolean
Tidak digunakan lagi
RemoveCustomStatus(status: string):boolean
Tidak digunakan lagi
RemoveStatus(status: Enum.Status):boolean
Tidak digunakan lagi
TakeDamage(amount: number):()
takeDamage(amount: number):()
Tidak digunakan lagi
Anggota yang Diwariskan
Contoh Kode
Efek Bobble Kamera Berjalan
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 -- Apakah karakter sedang berjalan?
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
-- Skala CameraOffset sehingga kembali ke posisi normal.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

Referensi API
Properti
AutoJumpEnabled
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.AutoJumpEnabled:boolean
Contoh Kode
Pengaturan Auto-Jump
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local button = script.Parent
local function update()
-- Perbarui teks tombol
if player.AutoJumpEnabled then
button.Text = "Auto-Jump AKTIF"
else
button.Text = "Auto-Jump TIDAK AKTIF"
end
-- Refleksikan properti di karakter pemain, jika mereka memilikinya
if player.Character then
local human = player.Character:FindFirstChild("Humanoid")
if human then
human.AutoJumpEnabled = player.AutoJumpEnabled
end
end
end
local function onActivated()
-- Toggel auto-jump
player.AutoJumpEnabled = not player.AutoJumpEnabled
-- Perbarui semua hal lainnya
update()
end
button.Activated:Connect(onActivated)
update()

AutomaticScalingEnabled
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.AutomaticScalingEnabled:boolean

AutoRotate
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.AutoRotate:boolean
Contoh Kode
Tombol AutoRotate
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() .. " tidak dapat lagi auto-rotate!")
humanoid.AutoRotate = false
else
print(humanoid:GetFullName() .. " sekarang dapat auto-rotate!")
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
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.BreakJointsOnDeath:boolean

CameraOffset
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.CameraOffset:Vector3
Contoh Kode
Efek Bobble Kamera Berjalan
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 -- Apakah karakter sedang berjalan?
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
-- Skala CameraOffset sehingga kembali ke posisi normal.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

CollisionType
Tidak digunakan lagi

DisplayDistanceType
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.DisplayDistanceType:Enum.HumanoidDisplayDistanceType
Contoh Kode
Menampilkan Kesehatan dan Nama Humanoid
local humanoid = script.Parent
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer
humanoid.HealthDisplayDistance = 0
humanoid.NameDisplayDistance = 100

DisplayName
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.DisplayName:string

EvaluateStateMachine
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.EvaluateStateMachine:boolean

FloorMaterial
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.FloorMaterial:Enum.Material

Health
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.Health:number

HealthDisplayDistance
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.HealthDisplayDistance:number

HealthDisplayType
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.HealthDisplayType:Enum.HumanoidHealthDisplayType

HipHeight
Baca Paralel
Kemampuan: AvatarAppearance
Akses Simulasi
Humanoid.HipHeight:number

Jump
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.Jump:boolean

JumpHeight
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.JumpHeight:number

JumpPower
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.JumpPower:number

LeftLeg
Tidak digunakan lagi

MaxHealth
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.MaxHealth:number

maxHealth
Tidak digunakan lagi

MaxSlopeAngle
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.MaxSlopeAngle:number
Contoh Kode
Membatasi Kemiringan yang Dapat Ditempuh oleh Humanoid
local player = game.Players.LocalPlayer
local char = player.CharacterAdded:wait()
local h = char:FindFirstChild("Humanoid")
h.MaxSlopeAngle = 30

MoveDirection
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.MoveDirection:Vector3
Contoh Kode
Efek Bobble Kamera Berjalan
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 -- Apakah karakter sedang berjalan?
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
-- Skala CameraOffset sehingga kembali ke posisi normal.
humanoid.CameraOffset = humanoid.CameraOffset * 0.75
end
end
RunService.RenderStepped:Connect(updateBobbleEffect)

NameDisplayDistance
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.NameDisplayDistance:number

NameOcclusion
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.NameOcclusion:Enum.NameOcclusion
Contoh Kode
Sembunyikan Nama Pemain
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
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.PlatformStand:boolean

RequiresNeck
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.RequiresNeck:boolean

RightLeg
Tidak digunakan lagi

RigType
Baca Paralel
Kemampuan: AvatarAppearance
Humanoid.RigType:Enum.HumanoidRigType

RootPart
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.RootPart:BasePart

SeatPart
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.SeatPart:BasePart

Sit
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.Sit:boolean

TargetPoint
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.TargetPoint:Vector3

Torso
Tidak digunakan lagi

UseJumpPower
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.UseJumpPower:boolean

WalkSpeed
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.WalkSpeed:number

WalkToPart
Baca Paralel
Kemampuan: AvatarBehavior
Humanoid.WalkToPart:BasePart

WalkToPoint
Baca Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid.WalkToPoint:Vector3

Metode
AddAccessory
Kemampuan: AvatarAppearance
Humanoid:AddAccessory(accessory:Instance):()
Parameter
accessory:Instance
Memberikan nilai
()
Contoh Kode
[Humanoid] Contoh Tambahkan Aksesori
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
Tidak digunakan lagi

AddStatus
Tidak digunakan lagi

ApplyDescription
Tidak digunakan lagi

ApplyDescriptionAsync
Hasil
Kemampuan: AvatarAppearance
Humanoid:ApplyDescriptionAsync(
humanoidDescription:HumanoidDescription, assetTypeVerification:Enum.AssetTypeVerification
):()
Parameter
humanoidDescription:HumanoidDescription
assetTypeVerification:Enum.AssetTypeVerification
Nilai Default: "Default"
Memberikan nilai
()

ApplyDescriptionReset
Tidak digunakan lagi

ApplyDescriptionResetAsync
Hasil
Kemampuan: AvatarAppearance
Humanoid:ApplyDescriptionResetAsync(
humanoidDescription:HumanoidDescription, assetTypeVerification:Enum.AssetTypeVerification
):()
Parameter
humanoidDescription:HumanoidDescription
assetTypeVerification:Enum.AssetTypeVerification
Nilai Default: "Default"
Memberikan nilai
()

BuildRigFromAttachments
Kemampuan: AvatarBehavior
Humanoid:BuildRigFromAttachments():()
Memberikan nilai
()
Contoh Kode
Port Lua dari BuildRigFromAttachments
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
-- Tulang mungkin mengandung RigAttachments yang lebih dalam yang menimpa level bagian
-- (skeleton R15+ yang diperpanjang).
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 tidak memiliki 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)
Pengimpor Paket R15
local AssetService = game:GetService("AssetService")
local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")
local PACKAGE_ASSET_ID = 193700907 -- Pemutus Sirkuit
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
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:ChangeState(state:Enum.HumanoidStateType):()
Parameter
Nilai Default: "None"
Memberikan nilai
()
Contoh Kode
Lompatan Ganda
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
Kemampuan: AvatarBehavior
Humanoid:EquipTool(tool:Instance):()
Parameter
Memberikan nilai
()

GetAccessories
Kemampuan: AvatarAppearance
Humanoid:GetAccessories():{any}
Memberikan nilai
Contoh Kode
Hapus Aksesori Setelah Memuat
local Players = game:GetService("Players")
local function onPlayerAddedAsync(player)
local connection = player.CharacterAppearanceLoaded:Connect(function(character)
-- Semua aksesori telah dimuat pada titik ini
local humanoid = character:FindFirstChildOfClass("Humanoid")
local numAccessories = #humanoid:GetAccessories()
print(("Menghancurkan %d aksesori untuk %s"):format(numAccessories, player.Name))
humanoid:RemoveAccessories()
end)
-- Pastikan kita memutuskan koneksi kita ke pemain setelah mereka pergi
-- untuk memungkinkan pemain diambil alih oleh garbage collector
player.AncestryChanged:Wait()
connection:Disconnect()
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAddedAsync, player)
end
Players.PlayerAdded:Connect(onPlayerAddedAsync)

GetAppliedDescription
Kemampuan: AvatarAppearance
Humanoid:GetAppliedDescription():HumanoidDescription
Memberikan nilai

GetBodyPartR15
Kemampuan: AvatarBehavior
Humanoid:GetBodyPartR15(part:Instance):Enum.BodyPartR15
Parameter
Memberikan nilai

GetLimb
Kemampuan: AvatarBehavior
Humanoid:GetLimb(part:Instance):Enum.Limb
Parameter
Memberikan nilai
Contoh Kode
Mengambil Anggota Humanoid
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 .. " adalah bagian dari anggota " .. limb.Name)
end
end

GetMoveVelocity
Kemampuan: AvatarBehavior
Humanoid:GetMoveVelocity():Vector3
Memberikan nilai

GetPlayingAnimationTracks
Tidak digunakan lagi

GetRelativeVelocityAtFloor
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:GetRelativeVelocityAtFloor():Vector3
Memberikan nilai

GetState
Tulis Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:GetState():Enum.HumanoidStateType
Memberikan nilai
Contoh Kode
Lompatan Ganda
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
Tulis Paralel
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:GetStateEnabled(state:Enum.HumanoidStateType):boolean
Parameter
Memberikan nilai
Contoh Kode
Mengatur dan Mendapatkan Status Humanoid
local humanoid = script.Parent:WaitForChild("Humanoid")
-- Atur status
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
-- Dapatkan status
print(humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping)) -- false

GetStatuses
Tidak digunakan lagi

HasCustomStatus
Tidak digunakan lagi

HasStatus
Tidak digunakan lagi

LoadAnimation
Tidak digunakan lagi

loadAnimation
Tidak digunakan lagi

Move
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:Move(
moveDirection:Vector3, relativeToCamera:boolean
):()
Parameter
moveDirection:Vector3
relativeToCamera:boolean
Nilai Default: false
Memberikan nilai
()
Contoh Kode
Menggerakkan Humanoid ke Depan
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
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:MoveTo(
location:Vector3, part:Instance
):()
Parameter
location:Vector3
Nilai Default: "nil"
Memberikan nilai
()
Contoh Kode
Humanoid MoveTo Tanpa Waktu Habis
local function moveTo(humanoid, targetPoint, andThen)
local targetReached = false
-- mendengarkan saat humanoid mencapai targetnya
local connection
connection = humanoid.MoveToFinished:Connect(function(reached)
targetReached = true
connection:Disconnect()
connection = nil
if andThen then
andThen(reached)
end
end)
-- mulai berjalan
humanoid:MoveTo(targetPoint)
-- eksekusi pada thread baru agar tidak menghasilkan fungsi
task.spawn(function()
while not targetReached do
-- apakah humanoid masih ada?
if not (humanoid and humanoid.Parent) then
break
end
-- apakah target telah berubah?
if humanoid.WalkToPoint ~= targetPoint then
break
end
-- segarkan waktu habis
humanoid:MoveTo(targetPoint)
task.wait(6)
end
-- putuskan koneksi jika masih terhubung
if connection then
connection:Disconnect()
connection = nil
end
end)
end
local function andThen(reached)
print((reached and "Tujuan tercapai!") or "Gagal mencapai tujuan!")
end
moveTo(script.Parent:WaitForChild("Humanoid"), Vector3.new(50, 0, 50), andThen)

PlayEmote
Tidak digunakan lagi

PlayEmoteAsync
Hasil
Kemampuan: AvatarBehavior
Humanoid:PlayEmoteAsync(emoteName:string):boolean
Parameter
emoteName:string
Memberikan nilai

RemoveAccessories
Kemampuan: AvatarAppearance
Humanoid:RemoveAccessories():()
Memberikan nilai
()
Contoh Kode
Hapus Aksesori Setelah Memuat
local Players = game:GetService("Players")
local function onPlayerAddedAsync(player)
local connection = player.CharacterAppearanceLoaded:Connect(function(character)
-- Semua aksesori telah dimuat pada titik ini
local humanoid = character:FindFirstChildOfClass("Humanoid")
local numAccessories = #humanoid:GetAccessories()
print(("Menghancurkan %d aksesori untuk %s"):format(numAccessories, player.Name))
humanoid:RemoveAccessories()
end)
-- Pastikan kita memutuskan koneksi kita ke pemain setelah mereka pergi
-- untuk memungkinkan pemain diambil alih oleh garbage collector
player.AncestryChanged:Wait()
connection:Disconnect()
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAddedAsync, player)
end
Players.PlayerAdded:Connect(onPlayerAddedAsync)

RemoveCustomStatus
Tidak digunakan lagi

RemoveStatus
Tidak digunakan lagi

ReplaceBodyPartR15
Kemampuan: AvatarAppearance
Humanoid:ReplaceBodyPartR15(
bodyPart:Enum.BodyPartR15, part:BasePart
Parameter
Memberikan nilai

SetStateEnabled
Kemampuan: AvatarBehavior
Akses Simulasi
Humanoid:SetStateEnabled(
):()
Parameter
enabled:boolean
Memberikan nilai
()
Contoh Kode
Cooldown Melompat
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
Kemampuan: AvatarBehavior
Humanoid:TakeDamage(amount:number):()
Parameter
amount:number
Memberikan nilai
()
Contoh Kode
Menghancurkan Humanoid
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
Tidak digunakan lagi

UnequipTools
Kemampuan: AvatarBehavior
Humanoid:UnequipTools():()
Memberikan nilai
()

Acara
AnimationPlayed
Tidak digunakan lagi

ApplyDescriptionFinished
Kemampuan: AvatarAppearance
Humanoid.ApplyDescriptionFinished(description:HumanoidDescription):RBXScriptSignal
Parameter

Climbing
Kemampuan: AvatarBehavior
Humanoid.Climbing(speed:number):RBXScriptSignal
Parameter
speed:number
Contoh Kode
Humanoid.Mendaki
local Players = game:GetService("Players")
local function onCharacterClimbing(character, speed)
print(character.Name, "sedang mendaki dengan kecepatan", speed, "stud / detik.")
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
Tidak digunakan lagi

CustomStatusRemoved
Tidak digunakan lagi

Died
Kemampuan: AvatarBehavior
Humanoid.Died():RBXScriptSignal
Contoh Kode
Humanoid.Died
local Players = game:GetService("Players")
local function onPlayerAdded(player)
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local function onDied()
print(player.Name, "telah meninggal!")
end
humanoid.Died:Connect(onDied)
end
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)

FallingDown
Kemampuan: AvatarBehavior
Humanoid.FallingDown(active:boolean):RBXScriptSignal
Parameter
active:boolean

FreeFalling
Kemampuan: AvatarBehavior
Humanoid.FreeFalling(active:boolean):RBXScriptSignal
Parameter
active:boolean

GettingUp
Kemampuan: AvatarBehavior
Humanoid.GettingUp(active:boolean):RBXScriptSignal
Parameter
active:boolean

HealthChanged
Kemampuan: AvatarBehavior
Humanoid.HealthChanged(health:number):RBXScriptSignal
Parameter
health:number
Contoh Kode
Humanoid.HealthChanged
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("Kesehatan humanoid", (currentHealth > health and "menurun sebesar" or "menaik sebesar"), change)
currentHealth = health
end
humanoid.HealthChanged:Connect(onHealthChanged)
end
player.CharacterAdded:Connect(onCharacterAdded)
Bilah Kesehatan
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- Tempelkan skrip ke dalam LocalScript yang
-- dipattern ke Frame di dalam Frame
local frame = script.Parent
local container = frame.Parent
container.BackgroundColor3 = Color3.new(0, 0, 0) -- hitam
-- Fungsi ini dipanggil ketika kesehatan humanoid berubah
local function onHealthChanged()
local human = player.Character.Humanoid
local percent = human.Health / human.MaxHealth
-- Ubah ukuran bilah dalam
frame.Size = UDim2.new(percent, 0, 1, 0)
-- Ubah warna bilah kesehatan
if percent < 0.1 then
frame.BackgroundColor3 = Color3.new(1, 0, 0) -- merah
elseif percent < 0.4 then
frame.BackgroundColor3 = Color3.new(1, 1, 0) -- kuning
else
frame.BackgroundColor3 = Color3.new(0, 1, 0) -- hijau
end
end
-- Fungsi ini dipanggil ketika pemain muncul
local function onCharacterAdded(character)
local human = character:WaitForChild("Humanoid")
-- Pola: perbarui sekali sekarang, kemudian setiap kali kesehatan berubah
human.HealthChanged:Connect(onHealthChanged)
onHealthChanged()
end
-- Hubungkan pendengar spawn kami; panggil jika sudah muncul
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end

Jumping
Kemampuan: AvatarBehavior
Humanoid.Jumping(active:boolean):RBXScriptSignal
Parameter
active:boolean

MoveToFinished
Kemampuan: AvatarBehavior
Humanoid.MoveToFinished(reached:boolean):RBXScriptSignal
Parameter
reached:boolean
Contoh Kode
Humanoid MoveTo Tanpa Waktu Habis
local function moveTo(humanoid, targetPoint, andThen)
local targetReached = false
-- mendengarkan saat humanoid mencapai targetnya
local connection
connection = humanoid.MoveToFinished:Connect(function(reached)
targetReached = true
connection:Disconnect()
connection = nil
if andThen then
andThen(reached)
end
end)
-- mulai berjalan
humanoid:MoveTo(targetPoint)
-- eksekusi pada thread baru agar tidak menghasilkan fungsi
task.spawn(function()
while not targetReached do
-- apakah humanoid masih ada?
if not (humanoid and humanoid.Parent) then
break
end
-- apakah target telah berubah?
if humanoid.WalkToPoint ~= targetPoint then
break
end
-- segarkan waktu habis
humanoid:MoveTo(targetPoint)
task.wait(6)
end
-- putuskan koneksi jika masih terhubung
if connection then
connection:Disconnect()
connection = nil
end
end)
end
local function andThen(reached)
print((reached and "Tujuan tercapai!") or "Gagal mencapai tujuan!")
end
moveTo(script.Parent:WaitForChild("Humanoid"), Vector3.new(50, 0, 50), andThen)

PlatformStanding
Kemampuan: AvatarBehavior
Humanoid.PlatformStanding(active:boolean):RBXScriptSignal
Parameter
active:boolean

Ragdoll
Kemampuan: AvatarBehavior
Humanoid.Ragdoll(active:boolean):RBXScriptSignal
Parameter
active:boolean

Running
Kemampuan: AvatarBehavior
Humanoid.Running(speed:number):RBXScriptSignal
Parameter
speed:number
Contoh Kode
Humanoid Berlari
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} sedang berlari`)
else
print(`{localPlayer.Name} telah berhenti`)
end
end
humanoid.Running:Connect(function(speed: number)
onRunning(speed)
end)

Seated
Kemampuan: AvatarBehavior
Humanoid.Seated(
active:boolean, currentSeatPart:BasePart
Parameter
active:boolean
currentSeatPart:BasePart
Contoh Kode
Mencari Kursi Pemain
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local function onSeated(isSeated, seat)
if isSeated then
print("Saya sekarang duduk di: " .. seat.Name .. "!")
else
print("Saya tidak duduk di mana pun")
end
end
humanoid.Seated:Connect(onSeated)

StateChanged
Kemampuan: AvatarBehavior
Contoh Kode
Partikel Melompat
local character = script.Parent
local primaryPart = character.PrimaryPart
-- buat partikel
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
-- dengarkan status humanoid
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)
Cooldown Melompat
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
Kemampuan: AvatarBehavior
Humanoid.StateEnabledChanged(
Parameter
isEnabled:boolean
Contoh Kode
Detektor Perubahan Status Humanoid
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 .. " telah diaktifkan")
else
print(state.Name .. " telah dinonaktifkan")
end
end
humanoid.StateEnabledChanged:Connect(onStateEnabledChanged)

StatusAdded
Tidak digunakan lagi

StatusRemoved
Tidak digunakan lagi

Strafing
Kemampuan: AvatarBehavior
Humanoid.Strafing(active:boolean):RBXScriptSignal
Parameter
active:boolean

Swimming
Kemampuan: AvatarBehavior
Humanoid.Swimming(speed:number):RBXScriptSignal
Parameter
speed:number

Touched
Kemampuan: AvatarBehavior
Humanoid.Touched(
touchingPart:BasePart, humanoidPart:BasePart
Parameter
touchingPart:BasePart
humanoidPart:BasePart
Contoh Kode
Sentuhan Midas
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("Emas")
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
-- batalkan semua emas
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, logo Roblox, dan Powering Imagination termasuk dalam merek dagang kami yang terdaftar dan tidak terdaftar di AS dan negara lainnya.