(SOLVED)How to make a badge be awarded once you get lets say 100 points on a leaderstat

How are you testing it? I don’t think it works in studio, you might have to get someone to help test it who doesn’t have the badge, or add some sort of print statement before or after the awardbadge to know it’s getting to that part and thus able to award hte badge

If need be I can test it for you

im gonna make a game to test it in (a test game)

werid the code didnt work and yes it was in a game yes i made a badge for it and replaced the badge code with that badgeid

Did you try it out on yourself or with someone else?

Wait wait I think I see the issue, your parameter i nthe changed event is the same as the intvalue, they’re both aliveTime

yeah try to test my code if you can it might just be smtn dumb im doing

what should i set it to (the changed text) or the (if alivetime > 49)

For the aliveTime in the brackets and in the if aliveTime then, change them to whatever works for you, I’d recommend newValue as I did

Though again you may need someone to test it for you since I’m not sure what happens if you remove the badge from your inventory

i tried on a alt account didn’t work ( i havent changed the code yet so i will do that now)

do i need to make a variable for it or no like a local newValue = blah blah blah

Change the aliveTime I mentioned in those places to newValue, if you’re confused, look at how I did it in the code I wrote in one of my replies

becuase replacing it creates an error

ok i will try to test again in my test game

werid still dosent work i wonder whats wrong with it ill send a screenshot

1 Like

Are you testing it on yourself? You may need to test with another person if so

ive tried using 2 different accounts with them not having the badge

does my code have any errors? along the lines of that

Okay wait, maybe change UserHasBadge to UserHasBadgeAsync? Realised UserHasBadge is old

And also, I think thsi is the problem, awardbadge should also be given the userid of the player, so change it to

BadgeService:AwardBadge(plr.UserId, badgeID1)

The biggest “I forgor :skull:” moment I’ve done

lol werid how that badge award thing works for all of my other badge things

even with the outdated stuff like

It’s deprecated, it’ll still work if you use it but it’s not recommended, it’s only kept so old scripts work

Try out the 2 changes I mentioned and see if that helps