PDA

View Full Version : dynamic problem!



danulf
April 13th, 2005, 11:26 AM
here's the deal:
I have a timer in my game, and then when all the levels are done, all the times are showing...
Now I also have a password-thing, so that ppl can skip levels.
Then, when you've made all the levels, it just says "time: none" on those that you skipped, but that totally messes up a Total Time that I have.
It says nonenonenone4025 and so on...

Is there a way to say

If there's a number in 'time1', add that to total
or something...
Cause now all I have is:

total = time1 + time2 + time3 + time4 ...........

Hope you understand the question, and that you have a solution :D

glkngs
April 13th, 2005, 11:33 AM
total = 0;
if(typeoff(time1)==Number || time1 != "none"){
total += time1
}
if(typeoff(time2)==Number || time2 != "none"){
total += time2
}
// and so on...

danulf
April 13th, 2005, 11:38 AM
wow! A quick answer AND a script that I understood right away! Thanks man!

glkngs
April 13th, 2005, 11:41 AM
anytime :beer: