Solved summon lightning on rightclick

  • 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 skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Buildingabyss90

New Member
Jun 15, 2021
5
1
3
20
On rightclick:
if player's tool is golden hoe:
if lore of player's tool contains "Unbreaking V":
on damage of a player:
if attacker is player:
do:
strike lightning effect at the victim

is what i have so far
[doublepost=1623793659,1623793589][/doublepost]respond as quickly as you can please!
 
This code is very confusing - do u want it when you hit someone or when you right-click the tool?
Code:
# this would be right click
on right click with golden hoe:
  if lore of player's tool contains "Unbreaking V":
    strike lightning effect at target block of player

# this would be on damage
on damage of player:
  if lore of attacker's tool contains "Unbreaking V":
    strike lightning effect at the victim
 
Like if I rightclick i want it to summon lightning where im looking at.
[doublepost=1623948304,1623948225][/doublepost]
This code is very confusing - do u want it when you hit someone or when you right-click the tool?
Code:
# this would be right click
on right click with golden hoe:
  if lore of player's tool contains "Unbreaking V":
    strike lightning effect at target block of player

# this would be on damage
on damage of player:
  if lore of attacker's tool contains "Unbreaking V":
    strike lightning effect at the victim

i want to summon lighning where i look at on rightclick
 
Code:
on right click with golden hoe:
  if lore of player's tool contains "Unbreaking V":
    cancel event
    strike lightning effect at target block of player

But you know that "Unbreaking V" is an enchanted and not a lore?
 
I tried it and it works, it also adds explosion effect, adds damage and sets the target on fire. It also adds a distance limit to be able to cast this ability. everything can be modified and make it just throw the lightning

Code:
on rightclick:
    if player's tool is golden hoe:
        if lore of player's tool contains "Unbreaking V":
            player's target is set
            distance between the target and the player is more than 10:
                message "too far"
                stop
            strike lightning effect at the target
            damage target by 5
            create a fake explosion at the target
            ignite the target      
            stop

only lighting:

Code:
on rightclick:
    if player's tool is golden hoe:
        if lore of player's tool contains "Unbreaking V":
            player's target is set
            strike lightning effect at the target   
            stop
 
The "stop" after everything is useless, and I would change the first part to:
Code:
on right click with golden hoe:
  if lore of player's tool contains "Unbreaking V":
    if distance between the target and the player is less than 11:
      strike lightning effect at the target
      create a fake explosion at the target
      loop players in radius 2 around target block:
        ignite the loop-player
        damage loop-player by 5
 
ill try it out
[doublepost=1624473119,1624470713][/doublepost]
I tried it and it works, it also adds explosion effect, adds damage and sets the target on fire. It also adds a distance limit to be able to cast this ability. everything can be modified and make it just throw the lightning

Code:
on rightclick:
    if player's tool is golden hoe:
        if lore of player's tool contains "Unbreaking V":
            player's target is set
            distance between the target and the player is more than 10:
                message "too far"
                stop
            strike lightning effect at the target
            damage target by 5
            create a fake explosion at the target
            ignite the target     
            stop

only lighting:

Code:
on rightclick:
    if player's tool is golden hoe:
        if lore of player's tool contains "Unbreaking V":
            player's target is set
            strike lightning effect at the target  
            stop
i edited it to
on rightclick:
if player's tool is golden hoe:
if lore of player's tool contains "Unbreaking V":
player's target block is set
distance between the target and the player is more than 1000:
message "too far"
stop
strike lightning effect at the target block
damage target by 5
create a fake explosion at the target block
ignite the target
stop
and it works perfectly
 
  • Like
Reactions: nicolas toledo
Status
Not open for further replies.