Random damage and attr.
Bellow
BartenderMember, PRO Posts: 227
Hello i am trying to make random damage system but i cant find anything so i will try to make that actor hit random dmg 2,6
and also trying to make there is a stat called str ( like rpg games) if you give it 1 stat your attack take +2 so if you got 1 str your dmg random 2,6 and if you make your str 2 you dmg will be 4,8 how can i make something like that ?
Thank you for your help and sorry for my bad english
and also trying to make there is a stat called str ( like rpg games) if you give it 1 stat your attack take +2 so if you got 1 str your dmg random 2,6 and if you make your str 2 you dmg will be 4,8 how can i make something like that ?
Thank you for your help and sorry for my bad english
Comments
random(2, 6)
If you want to add a modifier to it you could do this:
random(2, 6) + game.str
Change Attribute: game.attackDamage = random(2, 6) + game.str
Then deduct that from your health/health bar:
Change Attribute: game.health = game.health - game.attackDamage
You now have stored in a variable the damage done that attack (game.attackDamage) which you can show either in a display with a display text behaviour or use to spawn a graphical number above or around the player/enemy, like you see in RPGs.