Title, very confused as to why this isn’t working.
I checked my inventory and I don’t have the badge. Please help.
Script:
local badgeID = 2148420348
local badgeService = game:GetService("BadgeService")
game.Players.PlayerAdded:Connect(function(player)
wait(1)
if not badgeService:UserHasBadge(player.UserId, badgeID) then
badgeService:AwardBadge(player.UserId, badgeID)
end
end)
4 Likes
local badgeID = 2148420348
local badgeService = game:GetService("BadgeService")
game.Players.PlayerAdded:Connect(function(player)
wait(1)
if not badgeService:UserHasBadgeAsync(player.UserId, badgeID) then
badgeService:AwardBadge(player.UserId, badgeID)
end
end)
Or maybe you have a badge and you didn’t notice.
2 Likes
I double-checked, I don’t have it.
Did it help? If not then double-check badgeId could probably be wrong. Where highlighted is IdBadge. The screen is of my badgeId.

See you need to use Server Script in ServerScriptService.
Still didn’t work, sorry.
(30 limit)
It is a server script in ServerScriptService.
That’s weird. It works for me.
In Roblox Studio gives me a badge, are you trying through Roblox Studio? Also see if the script is turned off.
No I went into the game in Roblox, and no the script is not turned off.
Try to get into Test Roblox Studio.
1 Like
“UserHasBadge” is deprecated, try using “UserHasBadgeAsync” instead.
Don`t worked. I gave him a script like this before
@GammerAtomYT Join the Test in roblox studio just try it.
1 Like
what do you mean I tested my game in roblox studio bro I got 5 hours of sleep bro im tired
Maybe you just forgot to Publish and tried to get badge in the game. It happens. I’ve been like that all day.
1 Like
nah b ro i published the game imm fine
You should check if your script does run, i have added some print functions to your code so only thing you need to do is just debug the script:
local badgeID = 2148420348
local badgeService = game:GetService("BadgeService")
game.Players.PlayerAdded:Connect(function(player)
wait(1)
print("Checking if " ..player.Name.. "has a badge, which id is: " ..badgeID.." ...")
if not badgeService:UserHasBadgeAsync(player.UserId, badgeID) then
print("Badge awarded to " ..player.Name.."!")
badgeService:AwardBadge(player.UserId, badgeID)
end
end)
2 Likes