Ep 42. Pet Storage Achievement Reward
We created the entire achievement system during this episode and also implemented some different reward types. One thing we forgot is related to the Pet Storage reward.
When the player completes an achievement for hatching a specific amount of eggs, they are rewarded with additional Pet Storage space. We did implement this reward but forgot to update the Pet Inventory GUI, which displays the amount of Pet Storage a player has.
The Pet Storage is updated inside of the Pet Inventory Gui in a few different ways. For instance, this will be updated each time a player receives or deletes a pet. So if they claimed the achievement reward and then did either of those actions, they would see the updated number.
Of course, we’d rather it update when the player receives the reward, so let’s implement this.
Solution
Add the following lines towards the bottom of your StarterPlayer/StarterPlayerScripts/Gui/PetInventory local script.
Remotes.Parent.ClaimAchievement.OnClientEvent:Connect(function()
task.delay(0, UpdateStorage)
end)