Update 2.7.0 - Burkino/SynapseX GitHub Wiki

SX v2.7.0 released - changelog:

[*] Patched debug.info based detections for good. See below for what you need to do to patch your scripts.
[*] Fixed stack traces not including SX functions.

This update includes a permanent fix for debug.info based detections. Below, we will show how to update your scripts.

In order to hook metamethods now, use the new function hookmetamethod. This will use the most up-to-date method of metamethod hooking, and wont cause incompatibility in case if we want to switch how metamethod hooks in the future. (which I expect will be common)

Examples:

-- <function> hookmetamethod(<Object> object, <string> metamethod, <function> hook)

local OldIndex
OldIndex = hookmetamethod(game, "__index", function(...)
    return OldIndex(...)
end)

local OldNewIndex
OldNewIndex = hookmetamethod(game, "__newindex", function(...)
    return OldNewIndex(...)
end)

local OldNamecall
OldNamecall = hookmetamethod(game, "__namecall", function(...)
    return OldNamecall(...)
end)

You pass the object to hook, the metamethod name, and a hook function. Newcclosure will be automatically applied if you pass a LClosure.

Please update your scripts to use this method ASAP. Your scripts will still be detected until you apply this.

Also, sorry for the long amount of time it took to release a 'full' fix. There is a ton of edge cases (which are conveniently ignored by our competitors), and I wanted to have a 100% fix before we released a breaking change.

The docs should be updated for this change in a few hours.

Sorry to mention this - you need to do vararg as well, some metamethods give different results with nil arguments. Follow the instructions here (except for using hookfunction, use hookmetamethod instead): https://v3rmillion.net/showthread.php?tid=1123406

You should expect invalid arguments being passed to your metamethod hooks as well, since a game can call your metamethod hooks now without 'actually' invoking a metamethod.

⚠️ **GitHub.com Fallback** ⚠️