kill AI, and grab all coins, but he’s is peaceful, so there’s no point of killing him.

I wanna try simplify my code, by telling my char to pick up only gold and silver coins;
Unfortunately, I did about 120 levels in forest, and there was not even one sign on this item.value definition, I think my char is not reacting to it. AI is always getting them first.

This is an empty statement (it serves no purpose for your program). Try putting this code into an if statement.

item.value == 2 || 3 is not doing what you think it does…

// this checks if (item.value is 2) OR (if 3 is a real value)
// and it will always evaluate to true
// see why at https://www.w3schools.com/js/js_booleans.asp
// in the section "Everything With a 'Real' Value is True"
if (item.value == 2 || 3) { }
// the correct way to check if item.value is 2 or 3
if (item.value == 2 || item.value == 3) { }
// or you could just do a 'greater than or equal to' check...

|| means or and it is a Boolean operator. It means that both sides by them selves get converted to either true or false. The 3 by itself is interpreted as true, then the whole if argumentwill always be true no matter what is on the other side.