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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

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

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

pvp toggle per player

Discussion in 'Skript' started by Kuzifes, Jul 13, 2019.

Thread Status:
Not open for further replies.
  1. Kuzifes

    Kuzifes Member

    Joined:
    Apr 25, 2017
    Messages:
    16
    Likes Received:
    0
    Did someone already createn a script like this?
     
  2. Best Answer:
    Post #2 by ShaneBee, Jul 13, 2019
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,093
    Likes Received:
    146
    Super simple (Haven't tested, but this should work)
    Code (Skript):
    1. command /pvptoggle:
    2.     trigger:
    3.         if {pvp::toggle::%uuid of player%} is true:
    4.             set {pvp::toggle::%uuid of player%} to false
    5.         else:
    6.             set {pvp::toggle::%uuid of player%} to true
    7.  
    8.  
    9. on damage of player:
    10.     if attacker is a player:
    11.         if {pvp::toggle::%uuid of victim%} is true:
    12.             cancel event
     
  4. Kuzifes

    Kuzifes Member

    Joined:
    Apr 25, 2017
    Messages:
    16
    Likes Received:
    0
    Thank you! I added that attackers who disabled it cannot attack.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,093
    Likes Received:
    146
    Ahh, duh that makes sense, totally forgot that part!
    I also forgot, and suggest to add, some messages when you toggle PVP on/off, I was more just writing the skeleton for you, and figured you could fill in what you need
     
Thread Status:
Not open for further replies.
Loading...