เรียนรู้
Engine Class
TestService
บริการ

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


สรุป
วิธีการ
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():()
เลิกใช้แล้ว
TakeSnapshot(snapshotname: string,source: Instance):()
Warn(condition: boolean,description: string,source: Instance,line: number):()
เหตุการณ์
สมาชิกที่ได้รับทอด

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
AutoRuns
อ่านพร้อมๆ กัน
TestService.AutoRuns:boolean

Description
อ่านพร้อมๆ กัน
TestService.Description:string

ErrorCount
อ่านอย่างเดียว
ไม่ซ้ำ
อ่านพร้อมๆ กัน
TestService.ErrorCount:number

ExecuteWithStudioRun
อ่านพร้อมๆ กัน
TestService.ExecuteWithStudioRun:boolean

Is30FpsThrottleEnabled
เลิกใช้แล้ว

IsPhysicsEnvironmentalThrottled
อ่านพร้อมๆ กัน
TestService.IsPhysicsEnvironmentalThrottled:boolean

IsSleepAllowed
อ่านพร้อมๆ กัน
TestService.IsSleepAllowed:boolean

NumberOfPlayers
อ่านพร้อมๆ กัน
TestService.NumberOfPlayers:number

SimulateSecondsLag
อ่านพร้อมๆ กัน
TestService.SimulateSecondsLag:number

TestCount
อ่านอย่างเดียว
ไม่ซ้ำ
อ่านพร้อมๆ กัน
TestService.TestCount:number

ThrottlePhysicsToRealtime
อ่านพร้อมๆ กัน
TestService.ThrottlePhysicsToRealtime:boolean

Timeout
อ่านพร้อมๆ กัน
TestService.Timeout:number

WarnCount
อ่านอย่างเดียว
ไม่ซ้ำ
อ่านพร้อมๆ กัน
TestService.WarnCount:number

วิธีการ
Check
TestService:Check(
condition:boolean, description:string, source:Instance, line:number
):()
พารามิเตอร์
condition:boolean
description:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:ตรวจสอบ
local TestService = game:GetService("TestService")
TestService:Check(false, "ตัวอย่าง")

Checkpoint
TestService:Checkpoint(
text:string, source:Instance, line:number
):()
พารามิเตอร์
text:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:Checkpoint
local TestService = game:GetService("TestService")
-- แสดงข้อความที่จุดตรวจ
TestService:Checkpoint("example")

Done
TestService:Done():()
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:เสร็จสิ้น
local TestService = game:GetService("TestService")
TestService:Done()

Error
TestService:Error(
description:string, source:Instance, line:number
):()
พารามิเตอร์
description:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
บริการทดสอบ:ข้อผิดพลาด
local TestService = game:GetService("TestService")
TestService:Error("นี่คือข้อผิดพลาด")

Fail
TestService:Fail(
description:string, source:Instance, line:number
):()
พารามิเตอร์
description:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()

isFeatureEnabled
TestService:isFeatureEnabled(name:string):boolean
พารามิเตอร์
name:string
ส่งค่ากลับ

Message
TestService:Message(
text:string, source:Instance, line:number
):()
พารามิเตอร์
text:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:Message
local TestService = game:GetService("TestService")
TestService:Message("ตัวอย่าง")

RegisterTest
TestService:RegisterTest(testOptions:Dictionary):TestCase
พารามิเตอร์
testOptions:Dictionary
ส่งค่ากลับ
TestCase

Require
TestService:Require(
condition:boolean, description:string, source:Instance, line:number
):()
พารามิเตอร์
condition:boolean
description:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:Require
local TestService = game:GetService("TestService")
TestService:Require(false, "ตัวอย่าง")

Run
เลิกใช้แล้ว

RunAsync
ผลตอบแทน
การรักษาความปลอดภัยของปลั๊กอิน
TestService:RunAsync():()
ส่งค่ากลับ
()

ScopeTime
TestService:ScopeTime():Dictionary
ส่งค่ากลับ

TakeSnapshot
TestService:TakeSnapshot(
snapshotname:string, source:Instance
):()
พารามิเตอร์
snapshotname:string
source:Instance
ค่าเริ่มต้น: "nil"
ส่งค่ากลับ
()

Warn
TestService:Warn(
condition:boolean, description:string, source:Instance, line:number
):()
พารามิเตอร์
condition:boolean
description:string
source:Instance
ค่าเริ่มต้น: "nil"
line:number
ค่าเริ่มต้น: 0
ส่งค่ากลับ
()
ตัวอย่างโค้ด
TestService:Warn
local TestService = game:GetService("TestService")
TestService:Warn(false, "this action is invalid")

เหตุการณ์
ServerCollectConditionalResult
TestService.ServerCollectConditionalResult(
condition:boolean, text:string, script:Instance, line:number
พารามิเตอร์
condition:boolean
text:string
script:Instance
line:number

ServerCollectResult
TestService.ServerCollectResult(
text:string, script:Instance, line:number
พารามิเตอร์
text:string
script:Instance
line:number

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