Jump to content

Headlight 1.0.6

$4.99
   (1 review)

6 Screenshots

Recommended Comments

jayinwww

Posted (edited)

Found another bug, other players who don't have permissions can stack miners hats on top of each other with a metal face mask. Ultimately giving someone is very high armor protection. So I have to remove the plugin for now.

Edited by jayinwww
beee

Posted

1 hour ago, jayinwww said:

Found another bug, other players who don't have permissions can stack miners hats on top of each other with a metal face mask. Ultimately giving someone is very high armor protection. So I have to remove the plugin for now.

Posting a fix for it soon

beee

Posted

6 hours ago, jayinwww said:

Found another bug, other players who don't have permissions can stack miners hats on top of each other with a metal face mask. Ultimately giving someone is very high armor protection. So I have to remove the plugin for now.

Posted fix.

Scalbox

Posted (edited)

Hi, I found and fixed a very serious bug.
If you wear miner hat together with the Eavy Plate Helmet, the head protection reaches 110%.
So I created this code that solves the problem.
Basically it checks that you have the light on your head and if you receive blows to the head, it decreases the damage by 20% (miner hat protects 20% from head damage).
It also simulates the effect of the heatshot, since being 110% protection, you don't even feel the effect of the heatshot.

Here is the code I added to the plugin.
 

private void OnEntityTakeDamage(BasePlayer player, HitInfo info)
{
  if (player == null || player.IsDead() || player.IsNpc || info.Initiator == null) return;
  if (player.inventory.containerWear.capacity <= 8) return;

  //Remove miner hat head protection
  var item = player.inventory.containerWear.GetSlot(8);
  if (info.boneArea == HitArea.Head && item.skin == SKINID)
  {
    var healthToRemove = info.damageTypes.Total() * 1.20f - info.damageTypes.Total();
    player.Hurt(healthToRemove);
    Effect.server.Run("assets/bundled/prefabs/fx/headshot.prefab", player.transform.position);
  }
}

image.png.2b5207fa5f4fd37c42548cf2a715587e.png
You could add it directly yourself, doing other more in-depth tests.

Thanks

Edited by Scalbox
beee

Posted

1 hour ago, Scalbox said:

Hi, I found and fixed a very serious bug.
If you wear miner hat together with the Eavy Plate Helmet, the head protection reaches 110%.
So I created this code that solves the problem.
Basically it checks that you have the light on your head and if you receive blows to the head, it decreases the damage by 20% (miner hat protects 20% from head damage).
It also simulates the effect of the heatshot, since being 110% protection, you don't even feel the effect of the heatshot.

That's not ideal as it would not work well with other plugins scaling damage or nullifying it, might be better if you will use that hook to use info.damageTypes.ScaleAll instead. When i have time will check if I can remove that wearable's protection properties instead of using OnEntityTakeDamage.

Scalbox

Posted

34 minutes ago, beee said:

That's not ideal as it would not work well with other plugins scaling damage or nullifying it, might be better if you will use that hook to use info.damageTypes.ScaleAll instead. When i have time will check if I can remove that wearable's protection properties instead of using OnEntityTakeDamage.

I can't scaleall, I have to remove the protection only from the head and not from the whole body.

The other possibility is to use baseprotection and decrease the damageType for Arrow and Bullet

 

 player.baseProtection.amounts[(int)DamageType.Arrow] = NEW VALUE;
player.baseProtection.amounts[(int)DamageType.Bullet] = NEW VALUE;

 

beee

Posted

@Scalboxis that a plugin you're using that shows protection? Miners hat does not have bullet protection, it has 13% protection against animals, 10% radiation, and 20% cold

Scalbox

Posted

I tried to remove the miner hat protection, but I didn't find a solution

Scalbox

Posted

Just now, beee said:

@Scalboxis that a plugin you're using that shows protection? Miners hat does not have bullet protection, it has 13% protection against animals, 10% radiation, and 20% cold

20% from bullet and arrow
image.png.df3f54655c1c36d091af3740d94ba8ec.png

beee

Posted

2 minutes ago, Scalbox said:

20% from bullet and arrow
image.png.df3f54655c1c36d091af3740d94ba8ec.png

yeah you're right, can use damageTypes.Scale(DamageType.Bullet and damageTypes.Scale(DamageType.Arrow then, will look into it thanks.

  • Like 1
Hero1220

Posted

is there a way to set this to a keybind?

 

beee

Posted

17 minutes ago, Hero1220 said:

is there a way to set this to a keybind?

 

bind key headlight on


There is no toggle though atm, will include it in next update.

  • Love 1
Scalbox

Posted

56 minutes ago, beee said:
bind key headlight on


There is no toggle though atm, will include it in next update.

My key bind

bind KEY ~meta.exec "headlight off" "headlight on"; meta.exec "headlight off"

  • Like 1
  • Love 1
Hero1220

Posted

1 hour ago, Scalbox said:

My key bind

bind KEY ~meta.exec "headlight off" "headlight on"; meta.exec "headlight off"

can i make it the same typical F key as normal miners helms? or will that cause issues with the vanilla keybind

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
  • Like 2
  • Haha 1
  • Love 1

User Feedback

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • 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.