so im trying to make a damage reduction script, heres the code:
the scoreboard works fine, same with the command, its the damage reduction part, i have tried like 50 different iterations, i set it back to this one to make it easier to understand and post here, it reduces damage by a flat number, not a percentage, how do i like add a percentage after the variable or smth to fix it idk how to explain
Code:
on join:
if {res::%player's uuid%} is not set:
set {res::%player's uuid%} to 0
on damage:
if {res::%victim's uuid%} is greater than 0:
reduce damage by {res::%victim's uuid%}
command setres [<player>] <integer>:
permission: op
trigger:
if arg-1 is set:
set {res::%arg-1's uuid%} to arg-2
if arg-1 is not set:
set {res::%player's uuid%} to arg-2
on join:
while player is online:
set title of player's scoreboard to "&aBurvival But &dBetter"
set line 1 of player's scoreboard to "&fPlayer: &6%player%"
set line 2 of player's scoreboard to "&7Server Ip: &8burvivalbutbetter.feathermc.gg"
set line 3 of player's scoreboard to "&cDamage Resistance: &9%{res::%player's uuid%}%"
wait 1 second
the scoreboard works fine, same with the command, its the damage reduction part, i have tried like 50 different iterations, i set it back to this one to make it easier to understand and post here, it reduces damage by a flat number, not a percentage, how do i like add a percentage after the variable or smth to fix it idk how to explain