It's working but in reverse. It's making the arg-1 in the command unable to get hit and can hit. I want it to make the arg-1 unable to hit but is able to get hit
[doublepost=1636732932,1636732777][/doublepost]Like when I type /disablepvp Brinnare, it gives god mode to Brinnare and he can hit others
[doublepost=1636733045][/doublepost]
Code:
command /disablepvp <player> [<timespan=10 seconds>]:
permission: pvp.disable
trigger:
set {pvp::disabled::%arg-1's uuid%} to arg-2 from now
send "&aPvP is now disabled for &e%arg-2%!" to arg-1
send "&aDisabled &e%arg-1%'s &aPvP for &e%arg-2%!" to player
on damage of player:
attacker is a player
if difference between now and {pvp::disabled::%victim's uuid%} >= 1 seconds:
cancel event
send "&cYou can't damage this player" to attacker
else:
delete {pvp::disabled::%victim's uuid%}
Something like that should work
Like when I type /disablepvp Brinnare, it gives god mode to Brinnare and he can hit others
[doublepost=1636733300][/doublepost]Thank you I fixed it by editing the code a bit:
command /disablepvp <player> [<timespan=10 seconds>]:
permission: pvp.disable
trigger:
set {pvp::disabled::%arg-1%} to arg-2 from now
send "&aPvP is now disabled for &e%arg-2%!" to arg-1
send "&aDisabled &e%arg-1%'s &aPvP for &e%arg-2%!" to player
on damage of player:
attacker is a player
if difference between now and {pvp::disabled::%attacker%} >= 1 seconds:
cancel event
send "&cYou can't damage this player" to attacker
else:
delete {pvp::disabled::%attacker%}