Give mobs effect on right click

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

skriptKiddie

Member
Jan 7, 2020
1
0
0
Skript Version (do not put latest): 2.4-MH

Skript Author: LetItDie & skriptKiddie
Minecraft Version: 1.15.1
---
Full Code:
Code:
on right click:

    # Check if it's the right tool
    name of the player's weapon is "[Harmonia]"
    tool of player is blaze rod
   
    # Check if player has a cooldown
    set {_waited} to difference between {harmonia.%player%.lastused} and now


    # If the cooldown is less than 120 seconds, tell them
    if {_waited} is less than 120 seconds:
        message "&8[&c!&8] &7You must wait &c%difference between 120 seconds and {_waited}% &7until you can use Harmonia again" to player

    # If it is more, proceed
    if {_waited} is more than 120 seconds:

        # Reset timer
        set {harmonia.%player%.lastused} to now

        loop all entities in radius 6 around player:
            apply slowness 4 to loop-entity for 30 seconds
            apply weakness 4 to loop-entity for 30 seconds
        remove slowness from player
        remove weakness from player


What's meant to happen: On right click with a blaze rod named "[Harmonia]", all mobs in a certain radius are meant to receive slowness and weakness for a few seconds.

What actually happens: Nothing actually happens on right click

There are no console errors and no errors on reload. I am not currently using any addons and I have tried to search the docs.
 
Status
Not open for further replies.