The if statement is unnecessary. Value objects have a specially designed version of Changed that only fires when the value changes and the new value is supplied as a parameter. In addition, your code would not run because value cannot be both the string Value and the value of the ValueObject.
I just realized I used value as the parameter when I should’ve put something such as “newvalue” to clarify that you’d need to use the new value of “(number)”.
As for the if statement, for one, I am accustomed to events which is why I wrote the if statement to check if the value exists, and as for the “specially designed version of changed”, I was not aware that was a thing, could you send me the api page including it?
I’ve already stated what the problem was: the check is unnecessary and it doesn’t even function fully. “It doesn’t harm the script’s integrity” isn’t really proper justification as to why you’d want to make your script do more unnecessary work. As for the code not working, I have highlighted this in a previous reply: please review it.
It’s not about whether the code functions or not at all. It’s unnecessary and there is no reason to be doing that, which is what I pointed out. It’s better to suggest proper code and, if error is acknowledged, to correct it rather than to leave it as a mistake.