Hey, I doing a rpg server so I did a stats for the armor that updates every tick but if I drop the armor from my armor slots it takes like 10 seconds to upadate...
anything that I missing?
anything that I missing?
Code:
every 1 tick:
loop all players:
#defence
if loop-player's helmet is not air:
set {lore::*} to lore of loop-player's helmet split at "||"
replace all "&7Defence: &a+" in {lore::1} with ""
set {def::%loop-player%::helmet} to {lore::1} parsed as an integer
else:
set {def::%loop-player%::helmet} to 0
if loop-player's chestplate is not air:
set {lore::*} to lore of loop-player's chestplate split at "||"
replace all "&7Defence: &a+" in {lore::1} with ""
set {def::%loop-player%::chestplate} to {lore::1} parsed as an integer
else:
set {def::%loop-player%::chestplate} to 0
if loop-player's leggings is not air:
set {lore::*} to lore of loop-player's leggings split at "||"
replace all "&7Defence: &a+" in {lore::1} with ""
set {def::%loop-player%::leggings} to {lore::1} parsed as an integer
else:
set {def::%loop-player%::leggings} to 0
if loop-player's boots is not air:
set {lore::*} to lore of loop-player's boots split at "||"
replace all "&7Defence: &a+" in {lore::1} with ""
set {def::%loop-player%::boots} to {lore::1} parsed as an integer
else:
set {def::%loop-player%::boots} to 0
#ferocity / speed / hp
if loop-player's helmet is not air:
set {lore::*} to lore of loop-player's helmet split at "||"
if {lore::3} contains "&7Ferocity: &c+":
replace all "&7Ferocity: &c+" in {lore::3} with ""
set {fer::%loop-player%::helmet} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Speed: &a+":
replace all "&7Speed: &a+" in {lore::3} with ""
set {speed::%loop-player%::helmet} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Health: &a+":
replace all "&7Health: &a+" in {lore::3} with ""
set {hp::%loop-player%::helmet} to {lore::3} parsed as an integer
else:
set {hp::%loop-player%::helmet} to 0
set {speed::%loop-player%::helmet} to 0
set {fer::%loop-player%::helmet} to 0
else:
set {hp::%loop-player%::helmet} to 0
set {speed::%loop-player%::helmet} to 0
set {fer::%loop-player%::helmet} to 0
if loop-player's chestplate is not air:
set {lore::*} to lore of loop-player's chestplate split at "||"
if {lore::3} contains "&7Ferocity: &c+":
replace all "&7Ferocity: &c+" in {lore::3} with ""
set {fer::%loop-player%::chestplate} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Speed: &a+":
replace all "&7Speed: &a+" in {lore::3} with ""
set {speed::%loop-player%::chestplate} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Health: &a+":
replace all "&7Health: &a+" in {lore::3} with ""
set {hp::%loop-player%::chestplate} to {lore::3} parsed as an integer
else:
set {hp::%loop-player%::chestplate} to 0
set {speed::%loop-player%::chestplate} to 0
set {fer::%loop-player%::chestplate} to 0
else:
set {hp::%loop-player%::chestplate} to 0
set {speed::%loop-player%::chestplate} to 0
set {fer::%loop-player%::chestplate} to 0
if loop-player's leggings is not air:
set {lore::*} to lore of loop-player's leggings split at "||"
if {lore::3} contains "&7Ferocity: &c+":
replace all "&7Ferocity: &c+" in {lore::3} with ""
set {fer::%loop-player%::leggings} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Speed: &a+":
replace all "&7Speed: &a+" in {lore::3} with ""
set {speed::%loop-player%::leggings} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Health: &a+":
replace all "&7Health: &a+" in {lore::3} with ""
set {hp::%loop-player%::leggings} to {lore::3} parsed as an integer
else:
set {hp::%loop-player%::leggings} to 0
set {speed::%loop-player%::leggings} to 0
set {fer::%loop-player%::leggings} to 0
else:
set {hp::%loop-player%::leggings} to 0
set {speed::%loop-player%::leggings} to 0
set {fer::%loop-player%::leggings} to 0
if loop-player's boots is not air:
set {lore::*} to lore of loop-player's boots split at "||"
if {lore::3} contains "&7Ferocity: &c+":
replace all "&7Ferocity: &c+" in {lore::3} with ""
set {fer::%loop-player%::boots} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Speed: &a+":
replace all "&7Speed: &a+" in {lore::3} with ""
set {speed::%loop-player%::boots} to {lore::3} parsed as an integer
else if {lore::3} contains "&7Health: &a+":
replace all "&7Health: &a+" in {lore::3} with ""
set {hp::%loop-player%::boots} to {lore::3} parsed as an integer
else:
set {hp::%loop-player%::boots} to 0
set {speed::%loop-player%::boots} to 0
set {fer::%loop-player%::boots} to 0
else:
set {hp::%loop-player%::boots} to 0
set {speed::%loop-player%::boots} to 0
set {fer::%loop-player%::boots} to 0
#strength
if name of loop-player's helmet is "&6Warden Helmet":
set loop-player's walking speed to {speed::%loop-player%} / 1000
set loop-player's flying speed to {speed::%loop-player%} / 1000
set {_h} to loop-player's helmet
set {_st} to ({speed::%loop-player%} / 10) * 150
set {lore::*} to {_h}'s lore split at "||"
set {lore::2} to "&7Strength: &c+%{_st}%"
set line 2 of lore of {_h} to "&7Strength: &c+%{_st}%"
set {lore::*} to {_h}'s lore split at "||"
set {_l} to {lore::2}
replace all "&7Strength: &c+" in {_l} with ""
set {st::%loop-player%::helmet} to {_l} parsed as an integer
else:
set loop-player's walking speed to {speed::%loop-player%} / 500
set loop-player's flying speed to {speed::%loop-player%} / 500
if loop-player's helmet is not air:
set {lore::*} to lore of loop-player's helmet split at "||"
replace all "&7Strength: &c+" in {lore::2} with ""
set {st::%loop-player%::helmet} to {lore::2} parsed as an integer
else:
set {st::%loop-player%::helmet} to 0
if loop-player's chestplate is not air:
set {lore::*} to lore of loop-player's chestplate split at "||"
replace all "&7Strength: &c+" in {lore::2} with ""
set {st::%loop-player%::chestplate} to {lore::2} parsed as an integer
else:
set {st::%loop-player%::chestplate} to 0
if loop-player's leggings is not air:
set {lore::*} to lore of loop-player's leggings split at "||"
replace all "&7Strength: &c+" in {lore::2} with ""
set {st::%loop-player%::leggings} to {lore::2} parsed as an integer
else:
set {st::%loop-player%::leggings} to 0
if loop-player's boots is not air:
set {lore::*} to lore of loop-player's boots split at "||"
replace all "&7Strength: &c+" in {lore::2} with ""
set {st::%loop-player%::boots} to {lore::2} parsed as an integer
else:
set {st::%loop-player%::boots} to 0
set {fer::%loop-player%} to {fer::%loop-player%::helmet} + {fer::%loop-player%::chestplate} + {fer::%loop-player%::leggings} + {fer::%loop-player%::boots}
set {hp::%loop-player%} to {hp::%loop-player%::helmet} + {hp::%loop-player%::chestplate} + {hp::%loop-player%::leggings} + {hp::%loop-player%::boots} + 100
set {speed::%loop-player%} to {speed::%loop-player%::helmet} + {speed::%loop-player%::chestplate} + {speed::%loop-player%::leggings} + {speed::%loop-player%::boots} + 100
set {st::%loop-player%} to {st::%loop-player%::helmet} + {st::%loop-player%::chestplate} + {st::%loop-player%::leggings} + {st::%loop-player%::boots} + 10
set {def::%loop-player%} to {def::%loop-player%::helmet} + {def::%loop-player%::chestplate} + {def::%loop-player%::leggings} + {def::%loop-player%::boots} + 10
set loop-player's max health to {hp::%loop-player%} / 10