Badge not awarding?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Hey, I’m confused about the whole badge service stuff. I’ve looked at the Roblox website describing how it all works but I’m just understanding. Site → BadgeService:AwardBadge (roblox.com) Below shows a script in a Part. Iv’e tested this a couple of times and I’m not receiving the badge. I’ve also checked to see if I own the badge, and I don’t. Can someone please help me understand?

local badgeservice = game:GetService("BadgeService")
local id = 2125499645
script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if not badgeservice:UserHasBadgeAsync(plr.UserId,id) then
			badgeservice:AwardBadge(plr.UserId,id)
		end
	end
end)
2 Likes

What is the script parented to?

Script looks like it should work (needs to be a server script though).

Works fine. Make sure it’s a script script. It can either be on ServiceScriptService, or under a part.

So would it be like this?

local badgeservice = game:GetService("BadgeService")
local id = 2125499645
game.Workspace.Test.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if not badgeservice:UserHasBadgeAsync(plr.UserId,id) then
			badgeservice:AwardBadge(plr.UserId,id)
		end
	end
end)

changes _> game.Workspace.Test.Touched:Connect(function(hit)

I should say, this badge is made under a group, does that change anything?

If test if your part. then yes.

No, badges can be awarded regardless of their owner [ as long as its available]

Test is the name of the part. The script is within the part

k, but ive tried this many times never got the badge awarded.

Then you can do script.Parent.Touched

Make sure it’s a script, not a local script

So this is the script. The script is in the part

local badgeservice = game:GetService("BadgeService")
local id = 2125499645
script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if not badgeservice:UserHasBadgeAsync(plr.UserId,id) then
			badgeservice:AwardBadge(plr.UserId,id)
		end
	end
end)

Just tried it, didn’t work. somethings not working

Is the badge available to get?

Also, you dont need to use ‘if not badgeservice:UserHasBadgeAsync(plr.UserId,id) then’

It automatically checks if the player has the badge or not.

You can’t get the same badge more than 1, you can get rid of this line : if not badgeservice:UserHasBadgeAsync(plr.UserId,id) then

Yes the badge is available, k let me make changes and ill see if it works.

For me it worked, make sure you really don’t have this badge in your inventory - else, you won’t get it because you apparently have it.

The script looks good, I dont see any error.

Tested it, doesn’t work.


I checked that after. I don’t own it.

You need to make sure the badge belongs to the game you’re testing it.