__eq not firing

Can’t get __eq to fire, here’s the part of the script which compare stuff.


Where it should be fired:

assert(LOAD_METHODS == not_released_callback(), 'Invalid load method!')

Part of the code which handles __eq.

local LOAD_METHODS = setmetatable({
	'ForceLoad',
	'Steal',
	'Cancel',
}, {
	__eq = function(self, target)
		print("__eq")
		for _, loadMethod in ipairs(self) do
			if loadMethod == target then
				return true
			end
		end
		return false
		--\\ Checks if a load method is valid.
	end;
});

Really need help guys!

and yes i am making a profileservice copy but for good reason don’t ask

By the way, it’s not the __eq not working, it’s __eq just not firing. That print in there, does not wanna print anything.

really quickly threw this into the lua demo compiler

Looks like if you are comparing a table to a table, it works fine
But the minute you compare it to a string it doesn’t do anything.

2 Likes