My "Welcome" badge isn't being rewarded

nah b ro i published the game imm fine

1 Like

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)
3 Likes

ok ill trrri debgu thanks ia lot

1 Like

The entire script runs fine, i dont know why it isn’t working.

1 Like

Aha, i got it.
Have you tried testing it on the Roblox Client, not through the Studio?

1 Like

Yes. This player also had the same problem, the script was normal but the badge was not issued.

2 Likes

I tested it in Roblox Studio Test Mode and playing it directly on roblox, both did not give me anything.

1 Like

Try using another device.
(30 limit)

2 Likes

OK
( :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: LIMIT) Limit limit lmiit

1 Like

Still didn’t work.
Limit limit limit 30 limit.

1 Like

Try using a similar script:

local badgeService = game:GetService("BadgeService")
local badgeId = 2148420348

game.Players.PlayerAdded:Connect(function(player)
	local owned = badgeService:UserHasBadgeAsync(player.UserId, badgeId)

	if not owned then
		badgeService:AwardBadge(player.UserId, badgeId)
	end
end)
2 Likes

did u enable the badge

1 Like

Is the badge owned by the same group or user as the game?

2 Likes

Cant rlly find anything wrong with the code in question(Besides the deprecated stuff). All i know of that could possibly cause this is:

  1. Playing in studio.

  2. Badge isnt owned by your account/group.

  3. Badge isnt enabled.

  4. You put the wrong id.

2 Likes

YES
:skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull:

1 Like

yes :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull: :skull:

1 Like

Check the badge’s game. Check the IDs, try to copy paste the code to another script object (it fixes roblox bugs sometimes :person_shrugging: )

1 Like

@GammerAtomYT Good for you for getting the badge :grin:

2 Likes

I know this is probably a stretch but did you publish your game?

1 Like

Can you stop spamming skull emojis. Also mark someone as the solution when you figured it out or post the solution.

1 Like