i’m making a custom hitbox system rn, and im sending a metatable from server to client. The server makes the metatable, stating the properties, and invokes a remotefunction. The client then gets the hits and returns them.
Server-Side
function hitmodule:Start()
keys[self.Key] = self
self.Connection = RunService.Heartbeat:Connect(function()
if self.Context == "Client" then
local detectedParts = Hitbox:InvokeClient(self)
local HitCharacter, Humanoid = unpack(detectedParts)
self.Touched:Fire(HitCharacter, Humanoid)
elseif self.Context == "Server" then
hitmodule:_cast()
hitmodule:_visual()
end
end)
end