I have trouble with creating creating a hud. I'm trying to make a hud to show if the player is ads and have a specific weapon. And if the player doesn't do that, the hud will be removed from the screen. However, no hud creates at all. And "self" is the player.
I have trouble with creating creating a hud. I'm trying to make a hud to show if the player is ads and have a specific weapon. And if the player doesn't do that, the hud will be removed from the screen. However, no hud creates at all. And "self" is the player.
It runs through and before it gets a chance to show it, it loops back around because of the while(1) and sees that text is now defined so it destroys the hud before you see it. Add a wait after it creates the hud or modify your code some other way to not destroy hud if the other two conditions exist, or something, and then it should work.
You could change this:
Code Snippet
Plaintext
if(isdefined(text)) { text destroy(); text = undefined; }
to this:
Code Snippet
Plaintext
if(isdefined(text) && !(self AdsButtonPressed())) { text destroy(); text = undefined; }
Last Edit: June 18, 2014, 09:24:33 pm by MakeCents
Hmm. It is still not working, it is so wierd imo. "else" is for if the others statements are false right? Well I tried to print and see what happens if I print in the else statement, and it printed even if the statements were true. Why is that happening even if the statement is true?
Hmm. It is still not working, it is so wierd imo. "else" is for if the others statements are false right? Well I tried to print and see what happens if I print in the else statement, and it printed even if the statements were true. Why is that happening even if the statement is true?
The reason it prints is because you put the print in the else statement. The first statement is only true when you ads. As soon as you do, it waits the total of the waits you have in and then continues to print, and neither statement is true until you release ads. Then again when you hit it again, and so on... If the print statement was in either if statement it would have behaved differently.
The reason it prints is because you put the print in the else statement. The first statement is only true when you ads. As soon as you do, it waits the total of the waits you have in and then continues to print, and neither statement is true until you release ads. Then again when you hit it again, and so on... If the print statement was in either if statement it would have behaved differently.