> if (sprite.x === sprite2.x && sprite.y === sprite2.y )
You are comparing if their origins are exactly overlapping. This is extremely unlikely to ever be true. You should use testOverlap instead, see
https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iworldinstance#internalH1Link3
I also recommend checking out the javascript examples since they'll cover most of the basic cases like that.
hey so i changed my script but still doesnt work
function onCollisionBetweenSprites(Sprite, sprite2) {
if (sprite.testOverlap(sprite2));
{
wood + 1
destroy,sprite2
}
}
onCollisionBetweenSprites;
this my new script