I’m trying to make a cheat code. Right now, if I type in lgcash, I get infinite money. The problem is that if I typed in letters in between, it still works; like if I typed in lgcasjjjjjjjh It would still work. I don’t like that. This is my code:
if(Input.GetKeyDown("l"))
{
one = true;
}
if(one == true && Input.GetKeyDown("g")){
two = true;
}
if(two == true && Input.GetKeyDown("c")){
three = true;
}
if(three == true && Input.GetKeyDown("a")){
four = true;
}
if(four == true && Input.GetKeyDown("s")){
five = true;
}
if(five == true && Input.GetKeyDown("h")){
Dontdestroy.playerscore = Mathf.Infinity;
}
Is there some sort of if statement where it says if the input was not g? Am I doing this entirely wrong? Because I feel like this could be done in a much easier way.
Thanks in advance.