I take it you're just starting to learn C (the programming language Game-Editor uses) then?
What you did is a common early-learning syntax error, you put a semicolon after the if() statement.
- Code: Select all
if(condition);
{
// stuff
}
These sort of conditional statements, like IF and WHILE, can't have a semicolon after them, or they don't do anything.
- Code: Select all
if(condition)
{
// stuff
}
Your condition is also wrong:
What I wrote earlier is the correct code ("score % 10 == 0"). You see, you can think of the "%" modulus operator as any other kind of operator, like "+" or "-". The code in "score % 10" will, instead of doing something like "score + 10", return the remainder of a division from "score / 10". For example, if "score" was "15", and you did "score % 10", it would give you "5" because 10 only goes into 15 once, with "5" left over.
The second half of it, "score % 10 == 0" checks if the remainder is "0", meaning that the number is cleanly divisible by 10.
- Code: Select all
if(score % 10 == 0)
{
// Code to do if score is a multiple of ten
}
P.S.
Code after a "//" on a line is a comment in the C programming language.