Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this join badge script that is supposed to give out a badge not work?

Asked by 4 years ago

i made a script for a badge in a game (its in a group) but it doesnt work.


local id = 2124471217 game.Players.PlayerAdded:Connect(function(plr) wait(1) local bs = game:GetService("BadgeService") bs:AwardBadge(plr.UserId,id) end)

1 answer

Log in to vote
0
Answered by 4 years ago

The problem is probably that you are trying to be awarded it in studio, or the fact that if you made it, you would already have it in your inventory. Try deleting it from your inventory and test it in the real game.

I have tested it (the script below) and it does print "Awarded Badge".

local id = 2124471217
game.Players.PlayerAdded:Connect(function(plr)
wait(1)
local bs = game:GetService("BadgeService")
bs:AwardBadge(plr.UserId,id)
print("Awarded Badge")
end)
0
i dont have the badge already. its for a group i dont own. the owner made it, and doesnt have it either. jdm4llfem8 94 — 4y
Ad

Answer this question