เรียนรู้
Engine Class
Seat

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
คุณสมบัติ
วิธีการ
Sit(humanoid: Instance):()
สมาชิกที่ได้รับทอด
ตัวอย่างโค้ด
การตรวจจับผู้ที่นั่ง
local Players = game:GetService("Players")
local seat = Instance.new("Seat")
seat.Anchored = true
seat.Position = Vector3.new(0, 1, 0)
seat.Parent = workspace
local currentPlayer = nil
local function onOccupantChanged()
local humanoid = seat.Occupant
if humanoid then
local character = humanoid.Parent
local player = Players:GetPlayerFromCharacter(character)
if player then
print(player.Name .. " ได้หามานั่ง")
currentPlayer = player
return
end
end
if currentPlayer then
print(currentPlayer.Name .. " ได้ลุกขึ้น")
currentPlayer = nil
end
end
seat:GetPropertyChangedSignal("Occupant"):Connect(onOccupantChanged)

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
Disabled
อ่านพร้อมๆ กัน
ความสามารถ: Basic, AvatarBehavior
การเข้าถึงการจำลองสถานการณ์
Seat.Disabled:boolean

Occupant
อ่านอย่างเดียว
ไม่ซ้ำ
อ่านพร้อมๆ กัน
ความสามารถ: Basic, AvatarBehavior
การเข้าถึงการจำลองสถานการณ์
Seat.Occupant:Humanoid

วิธีการ
Sit
ความสามารถ: Basic, AvatarBehavior
Seat:Sit(humanoid:Instance):()
พารามิเตอร์
humanoid:Instance
ส่งค่ากลับ
()

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ