So I'm trying to make an egg hatching system that involves a trade between a normal script and a local script. But I'm getting this error and I don't know why:
-- On normal script --
game.ReplicatedStorage.HatchEgg:InvokeClient(player, pet)
-- On local script --
game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(player, pet)
-- ...... --
end)
I dont know why LUA is treating OnClientEvent like an Instance. Thanks.

1 comment
I suggest using something other than InvokeClient, since it can hang forever if it throws an error.