Parry script - Small fun PvP mechanic
Parry script - Small fun PvP mechanic
Script: https://one.denizenscript.com/haste/62930
This script adds a PvP mechanic to your server, ready to use for all types of PvP.
It consists of parrying:
- When someone swings with a weapon that does at least 3 damage (To count it as a good weapon) and a cooldown percent higher than 45%, they are in a parry state for half a second (It looks like a lot of time but trust me, it's just right). If instead of a swing it's a hit, it will be for 0.3 seconds instead.
- When a parrying player is attacked, there are some checks to see if the parry works or not.
- First, it checks if the parrying player is looking directly at the entity. This way you can't parry something behind you.
- It checks if the difference between the damage of the parrying player's weapon and the weapon it's parrying is high (It's well calculated, don't worry about changing it. It works for all server styles) If it's false, the weapon damages are similar and it results in a parry. If it's true, it checks if the parrying player's weapon damage is the higher one. If that's true, the parry works.
So basically, if I swing at the same time an enemy player swings their weapon at me and we both have an iron sword (6 damage), it will result in a parry and the damage will be denied for both of us. If the damage difference is not too high, the same can happen between a wooden sword and an iron sword, This means that if I have a diamond sword (7) and someone with a wooden sword (4) tries to parry me, I have a way higher damage and so I will deny the parry.
This difference check is dynamic and is not a straight 3: A 70 damage weapon beats a 40 damage weapon. The same goes for arrows and projectiles, except it doesn't check the weapon damage, rather the projectile damage. This way, if someone shoots a power 10 arrow at me and I try to parry with a wooden sword, it will deny the parry.
Feedback is appreciated :)
This script adds a PvP mechanic to your server, ready to use for all types of PvP.
It consists of parrying:
- When someone swings with a weapon that does at least 3 damage (To count it as a good weapon) and a cooldown percent higher than 45%, they are in a parry state for half a second (It looks like a lot of time but trust me, it's just right). If instead of a swing it's a hit, it will be for 0.3 seconds instead.
- When a parrying player is attacked, there are some checks to see if the parry works or not.
- First, it checks if the parrying player is looking directly at the entity. This way you can't parry something behind you.
- It checks if the difference between the damage of the parrying player's weapon and the weapon it's parrying is high (It's well calculated, don't worry about changing it. It works for all server styles) If it's false, the weapon damages are similar and it results in a parry. If it's true, it checks if the parrying player's weapon damage is the higher one. If that's true, the parry works.
So basically, if I swing at the same time an enemy player swings their weapon at me and we both have an iron sword (6 damage), it will result in a parry and the damage will be denied for both of us. If the damage difference is not too high, the same can happen between a wooden sword and an iron sword, This means that if I have a diamond sword (7) and someone with a wooden sword (4) tries to parry me, I have a way higher damage and so I will deny the parry.
This difference check is dynamic and is not a straight 3: A 70 damage weapon beats a 40 damage weapon. The same goes for arrows and projectiles, except it doesn't check the weapon damage, rather the projectile damage. This way, if someone shoots a power 10 arrow at me and I try to parry with a wooden sword, it will deny the parry.
Feedback is appreciated :)
Last edited by jose_95 on December 20th, 2019, 8:54 am, edited 1 time in total.
- mcmonkey
- Site Admin
- Posts: 299
- Joined: August 5th, 2016, 7:27 pm
- Location: Los Angeles, California, USA
- Contact:
Re: Parry script - Small fun PvP mechanic
Can't even pass a monkeybot check.+++ I encountered 3 potential problems with that script.
+++ (1) WARNING: Line 63: Uneven number of <tag-marks>, are you missing a < or > ?
+++ (2) WARNING: Line 66: Uneven number of <tag-marks>, are you missing a < or > ?
+++ (3) WARNING: Line 71: Uneven number of <tag-marks>, are you missing a < or > ?
Denizen lead developer. On Discord as
mcmonkey#6666
.Re: Parry script - Small fun PvP mechanic
I must had put a past haste link, I fixed it on my server. Fixed.
Who is online
Users browsing this forum: No registered users and 3 guests