Skip to content

Commit

Permalink
namecall on non-instance data
Browse files Browse the repository at this point in the history
  • Loading branch information
Upbolt authored Jan 22, 2022
1 parent 430ab8b commit 8c844b3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/RemoteSpy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ local nmcTrampoline
nmcTrampoline = hookMetaMethod(game, "__namecall", function(...)
local instance = ...

if typeof(instance) ~= "Instance" then
return nmcTrampoline(...)
end

if remotesViewing[instance.ClassName] and instance ~= remoteDataEvent and remoteMethods[getNamecallMethod()] then
local remote = currentRemotes[instance]
local vargs = {...}
Expand Down Expand Up @@ -98,7 +102,10 @@ end
for _name, hook in pairs(methodHooks) do
local originalMethod
originalMethod = hookFunction(hook, newCClosure(function(instance, ...)

if typeof(instance) ~= "Instance" then
return originalMethod(instance, ...)
end

do
local success = pcall(checkPermission, instance)
if (not success) then return originalMethod(instance, ...) end
Expand Down

0 comments on commit 8c844b3

Please sign in to comment.