Ghi chú phát hành
Học
Lớp công cụ
TestService
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
Check(condition: boolean,description: string,source: Instance,line: number):()
Checkpoint(text: string,source: Instance,line: number):()
Done():()
Error(description: string,source: Instance,line: number):()
Fail(description: string,source: Instance,line: number):()
Message(text: string,source: Instance,line: number):()
RegisterTest(testOptions: Dictionary):TestCase
Require(condition: boolean,description: string,source: Instance,line: number):()
Run():()
Đã Lỗi Thời
TakeSnapshot(snapshotname: string,source: Instance):()
Warn(condition: boolean,description: string,source: Instance,line: number):()
Thành viên kế thừa

Tài Liệu Tham Khảo API
Thuộc Tính
AutoRuns
Đọc Song Song
TestService.AutoRuns:boolean

Description
Đọc Song Song
TestService.Description:string

ErrorCount
Chỉ Đọc
Không Sao Chép
Đọc Song Song
TestService.ErrorCount:number

ExecuteWithStudioRun
Đọc Song Song
TestService.ExecuteWithStudioRun:boolean

Is30FpsThrottleEnabled
Đã Lỗi Thời

IsPhysicsEnvironmentalThrottled
Đọc Song Song
TestService.IsPhysicsEnvironmentalThrottled:boolean

IsSleepAllowed
Đọc Song Song
TestService.IsSleepAllowed:boolean

NumberOfPlayers
Đọc Song Song
TestService.NumberOfPlayers:number

SimulateSecondsLag
Đọc Song Song
TestService.SimulateSecondsLag:number

TestCount
Chỉ Đọc
Không Sao Chép
Đọc Song Song
TestService.TestCount:number

ThrottlePhysicsToRealtime
Đọc Song Song
TestService.ThrottlePhysicsToRealtime:boolean

Timeout
Đọc Song Song
TestService.Timeout:number

WarnCount
Chỉ Đọc
Không Sao Chép
Đọc Song Song
TestService.WarnCount:number

Phương Pháp
Check
TestService:Check(
condition:boolean, description:string, source:Instance, line:number
):()
Tham Số
condition:boolean
description:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
Dịch vụ Kiểm Tra: Kiểm Tra
local TestService = game:GetService("TestService")
TestService:Check(false, "ví dụ")

Checkpoint
TestService:Checkpoint(
text:string, source:Instance, line:number
):()
Tham Số
text:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
Dịch vụ thử nghiệm: Điểm kiểm tra
local TestService = game:GetService("TestService")
TestService:Checkpoint("ví dụ")

Done
TestService:Done():()
Lợi Nhuận
()
Mẫu mã
Dịch vụ Kiểm Tra:Đã Xong
local TestService = game:GetService("TestService")
TestService:Done()

Error
TestService:Error(
description:string, source:Instance, line:number
):()
Tham Số
description:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
Dịch vụ kiểm tra: Lỗi
local TestService = game:GetService("TestService")
TestService:Error("đây là một lỗi")

Fail
TestService:Fail(
description:string, source:Instance, line:number
):()
Tham Số
description:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()

isFeatureEnabled
TestService:isFeatureEnabled(name:string):boolean
Tham Số
name:string
Lợi Nhuận

Message
TestService:Message(
text:string, source:Instance, line:number
):()
Tham Số
text:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
Dịch vụ kiểm tra: Thông điệp
local TestService = game:GetService("TestService")
TestService:Message("ví dụ")

RegisterTest
TestService:RegisterTest(testOptions:Dictionary):TestCase
Tham Số
testOptions:Dictionary
Lợi Nhuận
TestCase

Require
TestService:Require(
condition:boolean, description:string, source:Instance, line:number
):()
Tham Số
condition:boolean
description:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
TestService:Yêu cầu
local TestService = game:GetService("TestService")
TestService:Require(false, "ví dụ")

Run
Đã Lỗi Thời

RunAsync
Sinh Lợi
Bảo Mật Plugin
TestService:RunAsync():()
Lợi Nhuận
()

ScopeTime
TestService:ScopeTime():Dictionary
Lợi Nhuận

TakeSnapshot
TestService:TakeSnapshot(
snapshotname:string, source:Instance
):()
Tham Số
snapshotname:string
source:Instance
Giá Trị Mặc Định: "nil"
Lợi Nhuận
()

Warn
TestService:Warn(
condition:boolean, description:string, source:Instance, line:number
):()
Tham Số
condition:boolean
description:string
source:Instance
Giá Trị Mặc Định: "nil"
line:number
Giá Trị Mặc Định: 0
Lợi Nhuận
()
Mẫu mã
Dịch vụ Kiểm Tra: Cảnh Báo
local TestService = game:GetService("TestService")
TestService:Warn(false, "hành động này là không hợp lệ")

Sự Kiện
ServerCollectConditionalResult
TestService.ServerCollectConditionalResult(
condition:boolean, text:string, script:Instance, line:number
Tham Số
condition:boolean
text:string
script:Instance
line:number

ServerCollectResult
TestService.ServerCollectResult(
text:string, script:Instance, line:number
Tham Số
text:string
script:Instance
line:number

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