Solved Need PvpDisable Skript

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

Gino

Member
Apr 10, 2017
24
4
0
25
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
 
Try
Code:
on damage:
    damage cause is attack
    attacker is set
    tool of attacker is not any sword or bow
    {itemdisabled} is not set
    cancel event
    
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
 
Try
Code:
on damage:
    damage cause is attack
    attacker is set
    tool of attacker is not any sword or bow
    {itemdisabled} is not set
    cancel event
   
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
Thank you so much!
Going to check it now, hope it works
[doublepost=1555752248,1555751398][/doublepost]
Try
Code:
on damage:
    damage cause is attack
    attacker is set
    tool of attacker is not any sword or bow
    {itemdisabled} is not set
    cancel event
   
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
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?
 
Oh yeah makes sense hold on
[doublepost=1555752865,1555752696][/doublepost]Use this:
Code:
on damage:
    attacker is set
    {itemdisabled} is not set
    if damage cause is attack:
        tool of attacker is not any sword
        cancel event
    else if damage cause is projectile:
        projectile is an arrow
        cancel event
  
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
 
  • Like
Reactions: Gino
Oh yeah makes sense hold on
[doublepost=1555752865,1555752696][/doublepost]Use this:
Code:
on damage:
    attacker is set
    {itemdisabled} is not set
    if damage cause is attack:
        tool of attacker is not any sword
        cancel event
    else if damage cause is projectile:
        projectile is an arrow
        cancel event
 
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
Going to test it, i will let you know the result!
[doublepost=1555754003][/doublepost]
Oh yeah makes sense hold on
[doublepost=1555752865,1555752696][/doublepost]Use this:
Code:
on damage:
    attacker is set
    {itemdisabled} is not set
    if damage cause is attack:
        tool of attacker is not any sword
        cancel event
    else if damage cause is projectile:
        projectile is an arrow
        cancel event
 
command /itemdisabler:
    permission: itemdisabler.command
    trigger:
        if {itemdisabled} is set:
            delete {itemdisabled}
            message "&aItemdisabler enabled!"
        else:
            set {itemdisabled} to false
            message "&cItemdisabler disabled!"
It worked, Thank you so much!