Custom Bow

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

007L

Member
Nov 8, 2023
4
0
1
23
I would like a custom bow skript that makes fired arrow give the player hit blindness for 2 seconds and glowing for 5 seconds the bow should me called &0Void Bow
the skript should be based on the name of the bow disregarding the lore thank you very much
 
I haven't tested it, but it should work.
Code:
on projectile hit:
    if projectile is an arrow and shooter is a player:
        if bow of shooter is named "&0Void Bow":
            apply blindness to shooter for 2 seconds
            apply glowing to shooter for 5 seconds
 
I haven't tested it, but it should work.
Code:
on projectile hit:
    if projectile is an arrow and shooter is a player:
        if bow of shooter is named "&0Void Bow":
            apply blindness to shooter for 2 seconds
            apply glowing to shooter for 5 seconds
Whilst the code you provided is okay, there are some flaws with it (You may not be able to test it in game at times but you can always parse it!). Issue #1 is that in the event projectile hit, you cannot use ‘shooter’ for a placeholder for the player who spawns the projectile. This is why in the code below, I simply changed the first line to an on damage event (You can still check if a projectile is fired and what type it is in this event!). Also, I made it more simple by just checking for the name of the item as seen in the fixed code I attached below.
Code:
on damage:
   if projectile is an arrow:
      attacker is a player
      if name of attacker's tool is "&0Void Bow":
         apply blindness to victim for 2 seconds
         apply glowing to victim for 5 seconds
For the original poster: This bow will likely give ANY entity blindness and glowing. To change this, simply check if the victim is also a player. This code is also untested in game so let me know if there’s any issues with this code
 
I would like a custom bow skript that makes fired arrow give the player hit blindness for 2 seconds and glowing for 5 seconds the bow should me called &0Void Bow
the skript should be based on the name of the bow disregarding the lore thank you very much
We just have to set custom metadata values to the projectile, and then checking if the projectile a victim has recieved has that metadata and apply the effects! Enjoy.

Code:
on shoot:
    shooter is a player
    name of shooter's held item is "&0Void Bow"
    set metadata value "custom" of event-projectile to "&0Void Bow"

on damage:
    "%damage cause%" is "projectile"
    metadata value "custom" of event-projectile is "&0Void Bow"
    apply blindness to victim for 2 seconds
    apply glowing to victim for 5 seconds