I'd like to add a condition in a plugin like this:
If variable X = Y then
do this
else
do that
end
What is the correct syntax? And does "elsif" work for more than 2 cases?
let X = 5, Y = 6;
if ($gameVariable.value(X) === $gameVariable.value(Y)){
console.log("do this");
}else{
console.log("do that");
}
let X = 5, Y = 6;
if ($gameVariable.value(X) === $gameVariable.value(Y)){
console.log("if... do this");
}else if ($gameVariable.value(X) > $gameVariable.value(Y)){
console.log("else if... do this");
}else if ($gameVariable.value(X) < $gameVariable.value(Y)){
console.log("else if... do this");
}else{
console.log("else... do that"); // lol though this would never occur because every option possible is met above
}
No prob. Glad I could assist.Thanks, it worked.