Error with BadgeId

What do you want to achieve?
I’m making a part that when you click it, it awards the player a badge.

What is the issue?
I am getting this error in the output:
image

What solutions have you tried so far?
I have checked the Id of the badge to make sure I copied it correctly and I don’t think there’s
anything wrong with the script.

Script:

local badgeId = 2124496454
local badgeServ = game:GetService("BadgeService")

local function Activated(player)
	if player.PlayerGui.NoobFind.Frame.NoobCount.Text == "5" then
    badgeServ:AwardBadge(player.UserId, badgeId)
end
2 Likes

In the game window, right click on the badge and copy the badge id. Use that badge id instead of the one on the website url.

They’re the same Ids and I just tried it and still comes up with the same error.

Can you check if the ID is the same in the badge edit page

image - Badge edit page

2124496454 - Game explorer tab

Hmm that’s weird. That’s usually the way to get badge IDs. It’s even on the wiki page

That’s what I thought.
I’ve noticed that if I paste the badge Id on a shirt accessory page, it comes to this game:
image
I’m not sure if some ids are supposed to be the same but this is the only thing I can think of as to why it has that error.

Is this running on a server script or a local script?

It is running on a server script.

Try running the code in a live game.

Not related to your issue, but if you’re changing the text via local script, server won’t see the changes and consequently this if statement wouldn’t get passed.

Edit: I’m only assuming you’re changing the text via local script, if not, then just forget everything I said.

1 Like

Oh, it works in the actual game. I’m still confused with the error though.

It’s probably an issue with badge service not being able to fully run in studio, so it can’t determine if the passed badge ID is really a badge asset.

2 Likes