Ghi chú phát hành
Học
Lớp công cụ
Selection
Không Thể Tạo
Dịch Vụ

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.


Tóm Tắt
Phương Pháp
Add(instancesToAdd: Instances):()
Get():Instances
Remove(instancesToRemove: Instances):()
Set(selection: Instances):()
Thành viên kế thừa
Mẫu mã
Lựa chọn
local Selection = game:GetService("Selection")
for _, object in pairs(Selection:Get()) do
if object:IsA("BasePart") then
object.CFrame = object.CFrame * CFrame.Angles(0, math.pi / 2, 0)
end
end

Tài Liệu Tham Khảo API
Thuộc Tính
SelectionThickness
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: Basic
Selection.SelectionThickness:number

Phương Pháp
Add
Bảo Mật Plugin
Các khả năng: Basic
Selection:Add(instancesToAdd:Instances):()
Tham Số
instancesToAdd:Instances
Lợi Nhuận
()

Get
Bảo Mật Plugin
Các khả năng: Basic
Selection:Get():Instances
Lợi Nhuận
Instances
Mẫu mã
Lựa chọn
local Selection = game:GetService("Selection")
for _, object in pairs(Selection:Get()) do
if object:IsA("BasePart") then
object.CFrame = object.CFrame * CFrame.Angles(0, math.pi / 2, 0)
end
end
Thay đổi lựa chọn.Chọn
local selection = game:GetService("Selection")
selection.SelectionChanged:Connect(function()
print("Lựa chọn chứa " .. #selection:Get() .. " mục.")
end)

Remove
Bảo Mật Plugin
Các khả năng: Basic
Selection:Remove(instancesToRemove:Instances):()
Tham Số
instancesToRemove:Instances
Lợi Nhuận
()

Set
Bảo Mật Plugin
Các khả năng: Basic
Selection:Set(selection:Instances):()
Tham Số
selection:Instances
Lợi Nhuận
()
Mẫu mã
Tập hợp lựa chọn
local Selection = game:GetService("Selection")
local newSelection = {}
for _, object in pairs(workspace:GetDescendants()) do
if object:IsA("BasePart") and object.BrickColor == BrickColor.new("Bright red") then
table.insert(newSelection, object)
end
end
Selection:Set(newSelection)

Sự Kiện
SelectionChanged
Các khả năng: Basic
Selection.SelectionChanged():RBXScriptSignal
Mẫu mã
Thay đổi lựa chọn.Chọn
local selection = game:GetService("Selection")
selection.SelectionChanged:Connect(function()
print("Lựa chọn chứa " .. #selection:Get() .. " mục.")
end)

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.