Ghi chú phát hành
Học
Lớp công cụ
Debris
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
Thuộc Tính
MaxItems:number
Đã Lỗi Thời
Phương Pháp
AddItem(item: Instance,lifetime: number):()
addItem(item: Instance,lifetime: number):()
Đã Lỗi Thời
Thành viên kế thừa
Mẫu mã
Thêm Đồ Thân
local Debris = game:GetService("Debris")
local ball = Instance.new("Part")
ball.Anchored = false
ball.Shape = Enum.PartType.Ball
ball.TopSurface = Enum.SurfaceType.Smooth
ball.BottomSurface = Enum.SurfaceType.Smooth
ball.Size = Vector3.new(1, 1, 1)
local RNG = Random.new()
local MAX_VELOCITY = 10
while true do
local newBall = ball:Clone()
newBall.BrickColor = BrickColor.random()
newBall.CFrame = CFrame.new(0, 30, 0)
newBall.Velocity =
Vector3.new(RNG:NextNumber(-MAX_VELOCITY, MAX_VELOCITY), 0, RNG:NextNumber(-MAX_VELOCITY, MAX_VELOCITY))
newBall.Parent = game.Workspace
Debris:AddItem(newBall, 2)
task.wait(0.1)
end

Tài Liệu Tham Khảo API
Thuộc Tính
MaxItems
Đã Lỗi Thời

Phương Pháp
AddItem
Các khả năng: Basic
Debris:AddItem(
item:Instance, lifetime:number
):()
Tham Số
lifetime:number
Giá Trị Mặc Định: 10
Lợi Nhuận
()
Mẫu mã
Thêm Đồ Thân
local Debris = game:GetService("Debris")
local ball = Instance.new("Part")
ball.Anchored = false
ball.Shape = Enum.PartType.Ball
ball.TopSurface = Enum.SurfaceType.Smooth
ball.BottomSurface = Enum.SurfaceType.Smooth
ball.Size = Vector3.new(1, 1, 1)
local RNG = Random.new()
local MAX_VELOCITY = 10
while true do
local newBall = ball:Clone()
newBall.BrickColor = BrickColor.random()
newBall.CFrame = CFrame.new(0, 30, 0)
newBall.Velocity =
Vector3.new(RNG:NextNumber(-MAX_VELOCITY, MAX_VELOCITY), 0, RNG:NextNumber(-MAX_VELOCITY, MAX_VELOCITY))
newBall.Parent = game.Workspace
Debris:AddItem(newBall, 2)
task.wait(0.1)
end

addItem
Đã Lỗi Thời

©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.