Jump to content

Asking about crits again


Recommended Posts

I've posted a question here about giving a character I'm working on a crit rate. Someone responded, asking if I wanted the crits to apply to the character, the character when using ranged weapons, or to a custom item I want to give to my character. I asked about it applying to ranged weapons and the custom item, figuring that the two values would stack and encourage players to craft and use it. But it's been a month and I haven't gotten a response. I might as well ask again.

Oh, and I also need to know how to make it impossible and to guarantee the crits for testing.

Link to comment
Share on other sites

@icantevenname ahm well i am not really expert in this lua lenguage but as far as i know in everygame critical hits are applied by "RNG" wich is for random number generation so you could use the random function giving it it's own probabiliti and if the probability is fulfilled then give the character a 2x damage as an example. you can call a random generated number by doing this 

math.random() < .1

i that case the ".1" means 10% chance so that way you can give a probability to your critical hits, hope the info is useful for you, and good luck.

Sorry forgot to mention that all that can be coded in a function that executes on attack for example Wigfrid's onattack function "local function onattack(inst, data)"

Edited by RinShigure
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...