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.

Request PVP Toggle

Discussion in 'Requests' started by Spinydude, Oct 25, 2021.

Tags:
  1. Spinydude

    Spinydude Member

    Joined:
    Oct 25, 2021
    Messages:
    1
    Likes Received:
    0
    I've seen a few pvp toggle skripts for admins to turn it on and off for all players. But I've been trying to find one which individual players can toggle it on off for themselves, does anyone have a skript for this or if its not to much trouble to make one?
     
  2. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    60
    Likes Received:
    3
    It was pretty simple to make, but it doesnt check if a player is in combat when they run the command. Players require the permission sk.pvp to toggle.

    Code (Text):
    1.  
    2. command /combat:
    3.   permission: sk.pvp
    4.   trigger:
    5.     if {combat%player%} is not false:
    6.       set {combat%player%} to false
    7.       send "&aYou are no longer able to fight" to player
    8.     if {combat%player%} is false:
    9.       set {combat%player%} to true
    10.       send "&aYou are no now able to fight" to player
    11.  
    12. on damage of player:
    13.   if {combat%victim%} is false:
    14.     send "&4This player has combat off" to attacker
    15.     cancel event
    16.   if {combat%attacker%} is false:
    17.     cancel event
    18.     send "&4You can not attack while combat is off"
     
  3. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Code (Text):
    1. combat%player% --> combat::%player%
     
  4. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    60
    Likes Received:
    3
    whats the difference?
     
  5. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    I've never seen someone use that kind of variable, it's just hell nah. List variables are way better
     
  6. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    60
    Likes Received:
    3
    i learned skript through tutorials i barely paid attention to : p
    How would i format variables your way?
     
  7. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    {test::%player%} for example, the good thing is they can be looped. You cannot do that with normal ones
     
  8. Orangesanta8415

    Joined:
    Nov 21, 2020
    Messages:
    28
    Likes Received:
    0
    I don't want to necropost but I'm just saying instead of using %player% use %uuid of player% so that if the player changes their username, PVP will still be disabled for that player.
     

Share This Page

Loading...