SHARE
TWEET

lua metamethod c

Vzurxy Jun 9th, 2019 (edited) 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local game_meta = getrawmetatable(game) -- metatable
  2. local __index = game_meta.__index -- index
  3. local __namecall = game_meta.__namecall -- namecall
  4. local hook = newcclosure(function(self,...) -- get whatever object the function was called on
  5.    local Self = tostring(self)
  6.    local Type = __index(self,"ClassName") -- get the object classname the function was called on
  7.    local T = {self, ...}
  8.    if T[1] == game.ReplicatedStorage.modules.network["playerRequest_damageEntity"] and typeof(T[2]) == "Instance" and T[4] == "monster" then -- checks if remote being called is this ^
  9.    else
  10.    return (Type == "RemoteEvent" and new)(self,...) -- make sure it doesnt overwrite
  11.    end
  12. end)
  13. new = hookfunction(Instance.new("RemoteEvent").FireServer, hook, true) -- hook it true is optional, but does nothing
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top