Auto-translated
first, here's how it should be:it's better not to write anything outside of functions.local a = 0
second, here's this line:a neutral player is PLAYER_NONE. What is PLAYER_NAME, anyway? You need to use constant player numbers, for example, PLAYER_1.if prewOwner == PLAYER_NOON and newOwner == PLAYER_NAME
also, in the definition of the zoloto function, you need to specify that it has the parameters prewOwner and newOwner:function zoloto(prewOwner, newOwner)
PLAYER_NAME is any player. I want the script to work when any player captures this town.