• Log in or sign up for an account here: https://www.sythe.org/login

Hit Percent

tomanderson12

Member
Joined
Jan 21, 2008
Sythe Gold
0
Messages
53
Hit Percent
Im currently making a game in which you have to hit an image, you hit it the score goes up by one. Im trying to add a percentage hit, so I have two hidden labels one counting the forms click the other for the image. I have a label called lblpercent2. I thought it would just be

Code:
lblpercent2.caption = Val(text1.text) / Val(text2.text)

But that doesn't work
 
Hit Percent
If you PM me the source I may be able to help... but that post made no sense. :(
 
Hit Percent
Ok, so the problem was that you weren't finding the percentage correctly. It should be:
Code:
Percentage = Hits / (Hits + Misses) * 100
you had...
Code:
Percentage = Hits / Misses

So the code should be:
Code:
lblpercent2.Caption = Val(Text1.Text) / (Val(Text2.Text) + Val(Text1.Text)) * 100
-
Also, learn to use variables and correctly name your objects. >_>
 
Runescape Gamblingrunescape gambling
Back
Top