So i have been working on a skill gui with variables and stuff but there is a big problem i am facing right now. As i see i open the gui but it doesnt register the P in the format but if you click it once it registers. how can i make it so it always registers?
Code:
on level change:
add 2 to {p}
command /skills:
trigger:
create a gui with virtual chest with 3 rows named "&6Skills":
make gui 0 with book named "&6Skill Points" with lore "&7These are you're &6SKILL &7points that you||&7Can invest in custom abilities!||&6Skill Points: 0 / 100":
lore of gui-item contains "&6Skill Points: "
set {K::*} to lore of gui-item split at "||"
loop {K::*}:
if "%loop-value%" contains "&6Skill Points: ":
set {v} to loop-index parsed as integer
stop loop
set {K} to "%uncolored {K::%{v}%}%"
replace every "Attack Damage Level: " with "" in {K}
replace every " " with "" in {K}
set {C::*} to {K} split at "/"
set {P} to {C::1} parsed as number
make gui 0 with book named "&6Skill Points" with lore "&7These are you're &6SKILL &7points that you||&7Can invest in custom abilities!||&6Skill Points: %{p}% / 100"