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)
ok ill trrri debgu thanks ia lot
The entire script runs fine, i dont know why it isn’t working.
Aha, i got it.
Have you tried testing it on the Roblox Client, not through the Studio?
Yes. This player also had the same problem, the script was normal but the badge was not issued.
I tested it in Roblox Studio Test Mode and playing it directly on roblox, both did not give me anything.
Try using another device.
(30 limit)
OK
( LIMIT) Limit limit lmiit
Still didn’t work.
Limit limit limit 30 limit.
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)
did u enable the badge
Is the badge owned by the same group or user as the game?
Cant rlly find anything wrong with the code in question(Besides the deprecated stuff). All i know of that could possibly cause this is:
-
Playing in studio.
-
Badge isnt owned by your account/group.
-
Badge isnt enabled.
-
You put the wrong id.
YES
yes
Check the badge’s game. Check the IDs, try to copy paste the code to another script object (it fixes roblox bugs sometimes )
I know this is probably a stretch but did you publish your game?
Can you stop spamming skull emojis. Also mark someone as the solution when you figured it out or post the solution.