- Home /
Question by
Mr. Stimpson · Jan 12, 2016 at 08:27 AM ·
javascripting
Add a variable into a statement?
I'm going through a scripting tutorial and it's talking about if statements. It has just shown me how to do...
if (playerHealth <= 0) print ("You're Dead");
What if I wanted to do an else statement that does this...
else
{
print (("You've taken ") enemyDamage (" damage!"));
}
...to show how much damage the player has taken? Can't I add a variable into the statement?
Comment
Best Answer
Answer by tanoshimi · Jan 12, 2016 at 08:37 AM
print (("You've taken " + enemyDamage + " damage!"));
Your answer
Follow this Question
Related Questions
Changing Material In A Script? [Sorted] 1 Answer
Gun shooting help 2 Answers
Harry potter style game 1 Answer
how to run 3rd person automaticaly 1 Answer
JavaScript Error 0 Answers