Why doesn't the __newindex run?

As far as I know, __newindex is not fired when you remove a value from a table by setting it to nil, you may be better off doing this:

function mt:remove_player(player: Player)
	if not player then return end --> Checking if player exists.
	self.players[player] = false
end

This should still work with your if exists logic, as if statements like that will go off if a value is equal to something that’s not nil or false.

1 Like