Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

getscripts

The getscripts function will return all scripts located under DataModel, use getnilinstances if you want to retrieve scripts or objects that are not under the DataModel that might’ve been destroyed via :Destroy or .Parent = nil operations.

function getscripts(): {[number]: LuaSourceContainer}
for _: unknown, v: LuaSourceContainer in getscripts() do
print(v.ClassName);
end;

This function is useful if you want to retrieve scripts in game that are actively reparenting.

getinstances

The getinstances function will return all Instances that are located under DataModel, refer to getnilinstances if you wish to locate Instances that are not under the DataModel.

return getinstances(): {[number]: Instance}
for _: unknown, v: Instance in getinstances() do
print(v.Name);
end;

This function is useful if you want to retrieve instances in game that are actively reparenting.

compareinstances

The compareinstances will compare two Instances if they are equal to each-other, bypassing cloneref

function compareinstances(a: Instance, b: Instance): boolean
print(cloneref(workspace) == workspace) --> false
print(compareinstances(cloneref(workspace), workspace)); --> true

This function is useful if you want to compare two Instances when a == b is false when a or b is a product of cloneref

cloneref

The cloneref will clone the userdata reference of b, this is useful for bypassing reference detections, keep in note cloneref will NOT :Clone() the object.

function cloneref(obj: Instance): Instance
print(cloneref(game) == game); --> false
print(cloneref(game).GetService) --> function: 0x...

This function is useful for bypassing GC (Garbage Collection) detections.

getnilinstances

The getnilinstances function will retrieve all instances that are NOT parented under DataModel

function getnilinstances(): {[number]: Instance}
do
    local p: Part = Instance.new("Part");
    p.Parent = workspace;
    p.Name = "secret_part";
    p:Destroy();
end;
for _: unknown, v: Instance in getnilinstances() do
    if (v:Is("Part") and tostring(v) == "secret_part") then
        print(v.Parent); --> nil
    end;
end;

This function is useful if you want to retrieve an instance that has been destroyed to avoid getting accessed.

setscriptable

The setscriptable will block any script from trying to access Property of the provided Target to Toggle and will return the object’s previous scriptable state.

function setscriptable(object: Instance, property: string, toggle: boolean): boolean
local obj: Part = Instance.new("Part");
setscriptable(obj, "Name", false);
print(obj.Name); --> Name is not a valid Member of Part "Part"

This function is useful if you want to get detected

getcallbackmember

The getcallbackmember will return the function callback that is binded to Instance

function getcallbackmember(obj: Instance, name: string): (...any) -> (...any)
do -- pretend this is in another script
    local remote_function: RemoteFunction = game:GetService("ReplicatedStorage").RemoteFunction;
    remote_function.OnServerInvoke = function(...)
        return "hi";
    end;
end;

-- now our script
local callback: (...any) -> (...any) = getcallbackvalue(game:GetService("ReplicatedStorage").RemoteFunction, "OnServerInvoke");
print(callback); --> function: 0x...

This function is useful if you want to get a function binded to a method of an object without having said function.