Jump to content

Procent chance, php, sql


callesson

Recommended Posts

Hello guys!

 

I got this php game were your character has a specify damage and damagemax. Ex: 5-7.

Right now I have 3 cases. 2 cases where I hit random number between 5 and 7 and 1 case were I miss. So there is always 66% to hit.

You character can also have stats named "Hitchance", what I would like to achieve is to make your hit chance equal to your Stats.

 

Let us say we have 50% Hitchance, then when we attack we'r gonna hit with 50% chance.

Link to comment
https://forums.phpfreaks.com/topic/199493-procent-chance-php-sql/
Share on other sites

Yea, I got it now :P Ty ;D

 

Btw, Could you help with one more thing. So i dont need to make another topic ?

If I have stats like Strenght or Stamina, how can I make a code so 1 Stamina equals 10 Health ? And I want to do it as a equip a new armor or level up.

Or that 10 Weapon skill == 10 % Hitchance

 

I would preciate it! :D

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.