code_language.skript:
function USLAch_defineAchievement(player: player, group: string, id: string, name: string, desc: string, item: item):
set {_playeruuid} to uuid of {_player}
{USLAch.temp.%{_playeruuid}%.currentID} is {_group}
add 1 to {USLAch.temp.%{_playeruuid}%.achievementCount.%{USLAch.temp.%{_playeruuid}%.currentID}%}
set {USLAch.achievementList::%{_id}%} to {_id}
set {USLAch.achievementData.%{_id}%.name} to {_name}
set {USLAch.achievementData.%{_id}%.desc} to {_desc}
set {USLAch.achievementData.%{_id}%.genre} to {USLAch.temp.%{_playeruuid}%.currentGenre}
set {_slot} to {USLAch.temp.%{_playeruuid}%.achievementSlot} + 9
if {USLAch.playerData.%{_playeruuid}%.achievement::%{_id}%.status} is not set:
set {_temp} to "%{_desc}%||||&bNOT UNLOCKED"
create a gui slot {_slot} of {_player} with 1 of concrete powder:7 named "&f&l---" with lore {_temp}
else if {USLAch.playerData.%{_playeruuid}%.achievement::%{_id}%.status} is "claimed":
create a gui slot {_slot} of {_player} with 1 of {_item} named {_name} with lore {_desc}
else:
if {USLAch.achievementData.%{_id}%.rewards} is not set:
create a gui slot {_slot} of {_player} with 1 of {_item} named {_name} with lore {_desc}
else:
set {_temp} to "%{_desc}%||||&a&lREWARD AVAILABLE||&eClick to claim!"
create a gui slot {_slot} of {_player} with 1 of glowing {_item} named {_name} with lore {_temp} to run function USLAch_claimRewards({_player}, {_id})
add 1 to {USLAch.temp.%{_playeruuid}%.achievementSlot}
I made players can claim rewards of unlocking achievement by clicking the icon of the achievement in the list GUI.
The reward-claiming system itself works well but there's one visual problem
In the achievement list GUI,
Achievement icons with rewards available have "glowing" effect for the item (glowing %itemstack%)
Achievement icons with no rewards or with rewards that is already claimed don't have glowing effect
Also the lore changes between rewards-available icons and no-rewards icon.
The lore changing works successfully but even after claiming reward, the icons keep glowing.
When I reload the .sk file, the icon's glowing states will be fixed.
How can I solve this problem?
Other Information:
Server Version: Spigot 1.12.2 (Final build)
Skript Version: 2.2-dev37c
Addon for GUI: TuSKe 1.8.3-v2 (aka PikachuPatch)