/* Custom hooks with ability to debug? */ TribeLink.Hooks = {} function TribeLink:GetHooks() return TribeLink.Hooks end function TribeLink:RunHook(name, ...) local found = false for k, v in pairs(TribeLink.Hooks) do if v[1] == name then v[3](name, ...) if !found then found = true end break end end return found end function TribeLink:CallHook(name, gm, ...) local found = false for k, v in pairs(TribeLink.Hooks) do if v[1] == name then v[3](name, gm, ...) if !found then found = true end end end return found end function TribeLink:AddHook(name, unique, func) if TribeLink.Hooks[unique] then print("Hook " .. name .. "(" .. unique .. ") exists already updating existing entry.") end TribeLink.Hooks[unique] = { name, unique, func } return true end function TribeLink:RemoveHook(name, unique) if TribeLink.Hooks[unique] then TribeLink.Hooks[unique] = nil return true else print("Hook " .. name .. "(" .. unique .. ") doesn't exist and can't be removed.") return false end end /* Examples function MrDicks() print("Mister Dicks") end TribeLink:AddHook("Penis", "Vaginas", MrDicks) TribeLink:AddHook("Penis", "Vagina", function() print("Miss Dicks") end) */