Skip to main content
สคริปต์ bytecode และแบบสอบถามสภาพแวดล้อม

ฟังก์ชันที่ใช้ได้

decompile

decompile Roblox script และคืน source text ที่สร้างขึ้นเมื่อมี bytecode ให้ใช้ argument ต้องเป็น script Instance ที่รองรับ ถ้าไม่มี bytecode ที่ใช้ได้ function จะคืน nil

dumpstring

คืน decompressed bytecode string สำหรับ Roblox script object dumpstring ถูก register ไปยัง C++ function เดียวกับ getscriptbytecode ดังนั้นพฤติกรรมเหมือนกัน argument ต้องเป็น object bytecode reader ที่ใช้ร่วมกันรับค่า ClassName คือ ModuleScript, LocalScript, CoreScript และ Script สำหรับ Script นั้น RunContext ต้องเป็น Client หาก ClassName หายไป function จะเกิด “Invalid Instance” หาก ClassName ไม่ใช่ script class ที่รองรับ จะเกิด “Script expected” หากค่าเป็น Script ที่มี RunContext อื่น จะเกิด “Expected a Script with RunContext set to Client” หาก embedded bytecode reference ไม่ถูกต้อง หรือ stored bytecode มีความยาว 8 bytes หรือน้อยกว่า function จะคืน nil มิฉะนั้นจะ decompress stored bytecode ด้วย DecompressBytecode และคืน resulting bytes เป็น Luau string Hash mismatch, too-short compressed data หรือ ZSTD decompression errors จะถูกคืนเป็น error text bytes โดย DecompressBytecode แทนการ throw ที่นี่

getcallingscript

คืน script ที่เก็บอยู่บน current Luau thread object function นี้ไม่รับ arguments อ่าน the current thread script ซึ่งเป็น stored reference หาก stored reference นั้นไม่ expired function จะ push script Instance ด้วย Instance cache และคืนค่านั้น หาก stored reference expired function จะคืน nil function ไม่ตรวจ Lua call stack ไม่ค้นหา ancestor scripts และไม่ตรวจ script ClassName

getinstancesbyclass

คืน instances จาก Instance cache table ที่ ClassName field ตรงกับ string ที่ขอแบบ exact อาร์กิวเมนต์แรกอ่านด้วย string type checking empty string จะเกิด “ClassName required” function สร้าง array table ใหม่ วน cache ที่เก็บไว้ใต้ Instance cache เก็บเฉพาะ values ที่ Lua type เป็น object อ่าน ClassName field ของแต่ละ object value แล้วเปรียบเทียบกับ className ที่ขอด้วย strcmp matches จะถูกใส่แบบ sequential เริ่มที่ index 1 การ match เป็น exact และ case-sensitive function ไม่ใช้ IsA ไม่รวม subclasses ไม่ walk descendants ไม่ filter ด้วย Parent และไม่ sort result getinstancesofclass เป็น alias ของ function เดียวกัน

getloadedmodules

Returns a new array table containing live entries from loaded module list. The optional excludeCore argument is read with optional boolean handling and defaults to true when omitted or nil. If excludeCore is true, entries whose instance is a descendant of core packages or CoreGui are skipped. Expired weak entries and locked stored references without a value are skipped. The function pushes each remaining entry with Instance cache at sequential array indexes starting at 1. The function does not check ClassName, does not sort the result, and does not walk the DataModel.

getmenv

Returns the environment table associated with a ModuleScript. The argument must be a ModuleScript object. Invalid objects raise “Invalid Instance”, non-ModuleScript objects raise “ModuleScript expected”, and ModuleScripts without an available thread raise “invalid thread”. The function does not accept Script or LocalScript; use getsenv for those cases.

getreferencedby

Returns cached Instance values whose supported reference properties point to the provided Instance. The argument must be an Instance.

getrunningscripts

ส่งคืน array table ใหม่ของ unique script Instances ที่มาจาก live Lua threads function นี้ไม่รับ arguments โดยเดินผ่าน the live Luau thread list อ่านแต่ละ thread node และข้าม entries ที่ไม่มี thread node, ไม่มี weak thread ref, ไม่มี LiveLuaRef, ไม่มี Lua state, ไม่มี object หรือมี expired Script stored reference สำหรับ thread ที่เหลือแต่ละรายการ จะ lock scriptThread->object->Script(), deduplicate ด้วย script reference, push Instance ด้วย Instance cache และใส่ใน array indexes ต่อเนื่องเริ่มที่ 1 function ไม่สแกน DataModel ไม่ตรวจ ClassName และไม่ sort result

getscriptbytecode

คืน decompressed bytecode string สำหรับ Roblox script object getscriptbytecode ถูก register ไปยัง C++ function เดียวกับ dumpstring ดังนั้นพฤติกรรมเหมือนกัน argument ต้องเป็น object bytecode reader ที่ใช้ร่วมกันรับค่า ClassName คือ ModuleScript, LocalScript, CoreScript และ Script สำหรับ Script นั้น RunContext ต้องเป็น Client หาก ClassName หายไป function จะเกิด “Invalid Instance” หาก ClassName ไม่ใช่ script class ที่รองรับ จะเกิด “Script expected” หากค่าเป็น Script ที่มี RunContext อื่น จะเกิด “Expected a Script with RunContext set to Client” หาก embedded bytecode reference ไม่ถูกต้อง หรือ stored bytecode มีความยาว 8 bytes หรือน้อยกว่า function จะคืน nil มิฉะนั้นจะ decompress stored bytecode ด้วย DecompressBytecode และคืน resulting bytes เป็น Luau string Hash mismatch, too-short compressed data หรือ ZSTD decompression errors จะถูกคืนเป็น error text bytes โดย DecompressBytecode แทนการ throw ที่นี่

getscriptclosure

Loads the stored bytecode for a supported Roblox script Instance and returns it as a Lua closure. Returns nil when usable bytecode is not available.

getscripthash

ส่งคืน uppercase SHA384 hex digest สำหรับ stored bytecode string ของ Roblox script object โดย argument ต้องเป็น object helper ร่วม GetBytecode รับค่า ClassName เป็น ModuleScript, LocalScript, CoreScript และ Script สำหรับ Script นั้น RunContext ต้องเป็น Client หากไม่มี ClassName function จะ throw “Invalid Instance” หาก ClassName ไม่ใช่ script classes ที่รองรับ จะ throw “Script expected” หากค่าเป็น Script ที่มี RunContext อื่น จะ throw “Expected a Script with RunContext set to Client” หาก embedded bytecode reference ไม่ถูกต้องหรือความยาว stored bytecode เป็น 8 bytes หรือน้อยกว่า function จะคืน nil ไม่เช่นนั้นจะ hash stored bytecode bytes ที่ตรงจริงด้วย SHA384 แล้วคืน uppercase hex string function ไม่เรียก DecompressBytecode และไม่ hash decompressed bytecode

getscripts

ส่งคืนค่า script object ที่มีอยู่ใน Instance cache ในตอนนี้ function นี้ไม่รับ arguments โดยวนผ่าน cache ที่เก็บไว้ใต้ key Instance cache lightobject และพิจารณาเฉพาะ entries ที่ value เป็น object อ่าน field ClassName ของแต่ละ value ด้วย optional string handling entries แบบ LocalScript และ ModuleScript จะถูกใส่ในผลลัพธ์ entries แบบ Script จะถูกใส่เฉพาะเมื่อ RunContext offset เท่ากับ CLIENT หรือ PLUGIN ค่า ClassName อื่น entries ที่ไม่มี string ClassName และ CoreScript จะถูกข้าม ผลลัพธ์เป็น sequential Luau table function ไม่ traverse DataModel และไม่รับประกัน sorted order

getscriptthread

ส่งคืน Lua thread ที่เกี่ยวข้องกับ script object เมื่อ Real หาได้ argument ต้องเป็น object function อ่าน field ClassName ของค่าและ throw “not a valid Instance” หาก field นั้นไม่ใช่ string ค่า ClassName ที่รับคือ Script, LocalScript และ ModuleScript ค่าอื่นจะ throw “Script expected” ก่อนอื่นจะตรวจ ScriptThreadCache ของ Real ด้วย script reference หาก cache hit จะคืน cached Luau thread เป็น thread หาก cache miss ค่า Script ต้องมี RunContext Client ไม่เช่นนั้น function จะ throw “Expected a Script with RunContext set to Client” จากนั้นจะเดินผ่าน the live Luau thread list ตาม first weak thread reference ของแต่ละ thread node ไปยัง LiveLuaRef ข้าม missing thread data หรือ expired Script stored references และเทียบ script reference แต่ละตัวกับ script ที่ขอ หากพบ match จะคืน Luau thread นั้นเป็น thread หากไม่พบ match จะคืน nil

getsenv

Returns the environment table associated with a LocalScript, Script, or ModuleScript. Unsupported script objects or scripts without an available thread raise the same errors as the underlying script lookup.

loadstring

Compiles a Luau source string and returns the loaded function. If loading fails, it returns nil and an error message. The returned function is not executed automatically.