Activity Feed
Replied to thread: [HELP] OnClientInvoke w/ .__newindex
@SoundInfinity I was testing it in my own place too and it works! tysm I had been stuck for a couple of days now and I finally found a solution
Replied to thread: [HELP] OnClientInvoke w/ .__newindex
@SoundInfinity Also, when I run your code, nothing still appears in the output.
Replied to thread: [HELP] OnClientInvoke w/ .__newindex
@RealNickk I tried your code It gives me this error: "OnClientInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available"
CODE:
local Old; Old = hookfunction(game:GetService("ReplicatedStorage").RemoteFunction.OnClientInvoke, function(...)
local Args = {...}
warn(unpack(Args))
return Old(unpack(Args))
end)
Replied to thread: [HELP] OnClientInvoke w/ .__newindex
@RealNickk Isn't .__namecall used for things that have a ":" in them, for example: RemoteFunction:FireServer() OnClientInvoke uses "." example: RemoteFunction.OnClientInvoke = function(). I am most likely wrong about that though.
Created a new thread: [HELP] OnClientInvoke w/ .__newindex
I'm new to metatables and I'm trying to write a script that will run whenever "OnClientInvoke" is updated. Here's what I've come up with so far:
[code]
local mt = getrawmetatable(game)
local old = mt.__newindex
setreadonly(mt, false)
mt.__newindex = newcclosure(function(self, method, func)
if self == game:GetService("ReplicatedStorage").RemoteFunction and method == "OnClientInvoke" then
old_func = func
func = function(...)
local args = {...}
warn(unpack(args))
return old_func(...)
end
end
return old(self, method, func)
end)
[/code]
The issue is that nothing happens when "OnClientInvoke" is updated. I checked the developer console, and there are no errors or warnings. So, if anyone could assist me in resolving this problem, I would really appreciate it.