Skip to content
User Avatar
#3293
Auto-translated
Loli Nikita, please also check your end statements; something is clearly wrong there. Judging by the end statements, your function ends before the line:
local p2 = GetObjectiveState ('qwert3', 1);
So, what's the point of declaring all those local variables then? Also, I'm not sure, but is it true that if you write an if statement on one line, like you do:
if p2 == OBJECTIVE_COMPLETED then opr= opr+1
then the end after that is not needed? In any case, an end is required after the last elseif, specifically at the end of the code. This is not counting the end that closes the entire function, and it is currently in the wrong place. As a recommendation, it is better to name variables more clearly; this will not only make it easier for us on the forum, but you will also avoid getting confused yourself. A longer name is better; you might lose a little time typing, but you will gain a lot of time when debugging. The same goes for spaces. If it displays correctly on the forum (with the exception that the forum adds asterisks), I highly recommend following proper indentation. Otherwise, you have complete chaos, and it is clear that you will not be able to place these end statements intuitively without a detailed count.
 

К А
Стикеры GBF в Telegram

Statistics

Welcome our newest member: leyu