Hey so i made a skript so when you attack a player it strikes them and uses mana "our custom currency"
But i was wondering how can i do this with a potion effect?
Here is the skript
on damage of a player:
if attacker is player:
if tool of attacker is enchanted with smite:
set {_smite.chance} to a random integer between 1 and 30
set {Mana.%attacker%} to {Mana.%attacker%} parsed as integer
if {_smite.chance} is 2 or 5 or 7 or 10:
if {Mana.%attacker%} >= 25:
remove 25 from {Mana.%attacker%}
send "&aYou just used &eLightning Strike&a on your opponent!" to attacker
strike lightning effect at the victim
damage victim by 1.0 hearts
ignite victim
loop all entities in radius 3 of victim:
if loop-entity is not player:
damage loop-entity by 0.5 hearts
ignite loop-entity
else if {Mana.%attacker%} < 25:
set {_mana} to {Mana.%attacker%} parsed as integer
send "&cYou do not have enough mana to use this special attack! &bCurrent Mana: %{_mana}%" to attacker
else:
stop
But i was wondering how can i do this with a potion effect?
Here is the skript
on damage of a player:
if attacker is player:
if tool of attacker is enchanted with smite:
set {_smite.chance} to a random integer between 1 and 30
set {Mana.%attacker%} to {Mana.%attacker%} parsed as integer
if {_smite.chance} is 2 or 5 or 7 or 10:
if {Mana.%attacker%} >= 25:
remove 25 from {Mana.%attacker%}
send "&aYou just used &eLightning Strike&a on your opponent!" to attacker
strike lightning effect at the victim
damage victim by 1.0 hearts
ignite victim
loop all entities in radius 3 of victim:
if loop-entity is not player:
damage loop-entity by 0.5 hearts
ignite loop-entity
else if {Mana.%attacker%} < 25:
set {_mana} to {Mana.%attacker%} parsed as integer
send "&cYou do not have enough mana to use this special attack! &bCurrent Mana: %{_mana}%" to attacker
else:
stop