RbxStu V3 Docs
  • Welcome
  • Information
    • Engine Information
      • Luau API Security
  • Stunc
    • Overview
    • Connections
    • Filesystem
      • readfile
      • writefile
      • appendfile
      • isfile
      • isfolder
      • listfiles
      • makefolder
      • delfile
      • delfolder
      • loadfile
      • dofile
  • Memory
    • getgc
    • reference_object
    • unreference_object
    • get_gc_threshold
  • Closures
    • isunhookable
    • makeunhookable
    • ishooked
    • restorefunction
    • hookfunction
    • hookmetamethod
    • isourclosure
    • iscclosure
    • islclosure
    • clonefunction
    • newcclosure
    • newlclosure
    • loadstring
Powered by GitBook
On this page

Closures

Overview of the Closures libraries

The closure library in RbxStu V3 provides functions to manipulate and work with closures. These allow you to wrap and hook functions.

Why?

When attempting to debug or modify an environment to your needs, you cannot simply make your metamethod be a Luau closure, as, in ROBLOX, the game global (The DataModel), cannot have its metatable be modified, and if it is, its metamethods should ALWAYS be C closures and never Luau closures. This is why the library contains methods to wrap existing Luau closures into C closures and, should it ever be required, C closures to Luau closures.

Remarks

This section includes reflectivefunctions such as loadstring, that do not fit within the Reflection libraries category due to them targeting Instances, not the language itself.


The closures library has slight modifications to account for Luau and other needs that the modern developer expects.

Previousget_gc_thresholdNextisunhookable

Last updated 4 months ago