I want to give a badge when the value (Minutes in the leadboard) is 30, How can I do?

Here is my code :
image

What you would need to do is either have the if Minutes.Value == 30 then inside of the while true loop to see if when the value is changed it is 30 or you could use the event .Changed to detect if a propriety is changed and do it that way.

To give them the badge you would just use the badge service and on the badge service it would be :AwardBadge()

1 Like

First of all, having the while loop there to update the value every minute will yield the entire function so the if statement at the bottom will never give the badge.

Secondly, you need to be constantly checking if the minutes value is 30 or above to be able to give any player a badge, if it checks only once then it will never give the badge in the future.

So i recommend you have the player’s Minutes IntValue stored in a table and the while loop outside the function to loop through all the values to add and check at the same time.