Solved disable PvP to someone

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

OHOHOHO

Member
Feb 10, 2017
34
0
0
30
how do i disable pvp for player
[doublepost=1490289532,1490289494][/doublepost]this is only what i found in the doc
examples:
enable PvP #(current world only)
disable PvP in all worlds
 
this is easy:
code_language.skript:
command /pvp:
    permission: your.permission
    permission message: &cYou don't have permission for this.
    trigger:
        if {pvp.%player%} is not set:
            set {pvp.%player%} to false
            send "&cPvP disabled for you."
        else:
            delete {pvp.%player%}
            send "&aPvP enabled for you."

on damage:
    attacker is a player
    victim is set
    victim is a player
    {pvp.%victim%} is set
    cancel event

on damage:
    attacker is set
    attacker is a player
    victim is a player
    {pvp.%attacker%} is set
    cancel event
    send "&cYou can't do pvp while you pvp is disabled."
not tested, tell me any error you have
 
Status
Not open for further replies.