1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Need PvpDisable Skript

Discussion in 'Requests' started by Gino, Apr 19, 2019.

  1. Gino

    Gino Member

    Joined:
    Apr 10, 2017
    Messages:
    24
    Likes Received:
    4
    Category:
    Pvp
    Suggested name:
    ItemDisabler
    Spigot/Skript Version:
    Spigot 1.13.2
    What I want:
    I need a script, which only allow you to pvp if you hit someone with a sword or bow.


    Ideas for commands:
    Uhm, not necessery, but maybe /itemdisabler allow/deny (allows you to set the skript on/off for the hole server).

    Ideas for permissions:
    Not needed
    When I'd like it by: As soon as possible <3 ly guys


     
  2. Best Answer:
    Post #4 by TPGamesNL, Apr 20, 2019
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Try
    Code (Text):
    1. on damage:
    2.     damage cause is attack
    3.     attacker is set
    4.     tool of attacker is not any sword or bow
    5.     {itemdisabled} is not set
    6.     cancel event
    7.    
    8. command /itemdisabler:
    9.     permission: itemdisabler.command
    10.     trigger:
    11.         if {itemdisabled} is set:
    12.             delete {itemdisabled}
    13.             message "&aItemdisabler enabled!"
    14.         else:
    15.             set {itemdisabled} to false
    16.             message "&cItemdisabler disabled!"
     
  4. Gino

    Gino Member

    Joined:
    Apr 10, 2017
    Messages:
    24
    Likes Received:
    4
    Thank you so much!
    Going to check it now, hope it works
    --- Double Post Merged, Apr 20, 2019, Original Post Date: Apr 20, 2019 ---
    Very good script! Only problem is that you can hit people with a bow , you are only allowed to shoot with a bow, don't know if you want to change that?
     
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Oh yeah makes sense hold on
    --- Double Post Merged, Apr 20, 2019, Original Post Date: Apr 20, 2019 ---
    Use this:
    Code (Text):
    1. on damage:
    2.     attacker is set
    3.     {itemdisabled} is not set
    4.     if damage cause is attack:
    5.         tool of attacker is not any sword
    6.         cancel event
    7.     else if damage cause is projectile:
    8.         projectile is an arrow
    9.         cancel event
    10.  
    11. command /itemdisabler:
    12.     permission: itemdisabler.command
    13.     trigger:
    14.         if {itemdisabled} is set:
    15.             delete {itemdisabled}
    16.             message "&aItemdisabler enabled!"
    17.         else:
    18.             set {itemdisabled} to false
    19.             message "&cItemdisabler disabled!"
     
    • Like Like x 1
  6. Gino

    Gino Member

    Joined:
    Apr 10, 2017
    Messages:
    24
    Likes Received:
    4
    Going to test it, i will let you know the result!
    --- Double Post Merged, Apr 20, 2019 ---
    It worked, Thank you so much!
     
    • Friendly Friendly x 1

Share This Page

Loading...