Hook producing a random error that came out of the blue?

FIXED.

There is no need to create another thread…
Its nil beacouse in the second argument of the hook.Add function you are putting a panel, and you have to put a string!

No idea about the issue considering he snipped it, though, the second parameter to hook.Add can be any object you want it to be, as long as it has a IsValid method which returns true. It’ll also call the function provided with said object as the first argument.

E.g.



local Tab = {
  DoShit = function(self, ply)

  end,

  IsValid = function() return true end,
}

hook.Add("PlayerSpawn", Tab, Tab.DoShit)