From ff08e09f5624c2c2be4ce168cb4ca9be150cd31b Mon Sep 17 00:00:00 2001 From: jdpatdiscord <42700985+jdpatdiscord@users.noreply.github.com> Date: Fri, 28 Jan 2022 05:53:59 -0500 Subject: [PATCH] fix detection --- modules/RemoteSpy.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/RemoteSpy.lua b/modules/RemoteSpy.lua index 01a0ffa7..1d9c5a7d 100644 --- a/modules/RemoteSpy.lua +++ b/modules/RemoteSpy.lua @@ -58,9 +58,7 @@ nmcTrampoline = hookMetaMethod(game, "__namecall", function(...) if remotesViewing[instance.ClassName] and instance ~= remoteDataEvent and remoteMethods[getNamecallMethod()] then local remote = currentRemotes[instance] - local vargs = {...} - - table.remove(vargs, 1) + local vargs = {select(2, ...)} if not remote then remote = Remote.new(instance) @@ -101,19 +99,21 @@ end for _name, hook in pairs(methodHooks) do local originalMethod - originalMethod = hookFunction(hook, newCClosure(function(instance, ...) + originalMethod = hookFunction(hook, newCClosure(function(...) + local instance = ... + if typeof(instance) ~= "Instance" then - return originalMethod(instance, ...) + return originalMethod(...) end do local success = pcall(checkPermission, instance) - if (not success) then return originalMethod(instance, ...) end + if (not success) then return originalMethod(...) end end if remotesViewing[instance.ClassName] and instance ~= remoteDataEvent then local remote = currentRemotes[instance] - local vargs = {...} + local vargs = {select(2, ...)} if not remote then remote = Remote.new(instance) @@ -139,7 +139,7 @@ for _name, hook in pairs(methodHooks) do end end - return originalMethod(instance, ...) + return originalMethod(...) end)) oh.Hooks[originalMethod] = hook