Hello there,
So I'm trying to make a script that awards player a badge when a bool value is "true". I know UserID is not a valid member of "Players" thing, but I'm a noob at scripting and I have no idea what to put instead. What should I do now? Here's the script;
while wait() do
if game.Workspace.CongratsBadge.Value==true then
local badgeID = [MyBadgeID]
local badgeService = game:GetService("BadgeService")
for _,v in pairs(game.Players:GetPlayers()) do
if not badgeService:UserHasBadge(game.Players.UserId, badgeID) then
badgeService:AwardBadge(game.Players.UserId, badgeID)
end
end
end

1 comment
Thank you so much, it worked. I can't still believe I just missed the fact that "v" is a value that I'm Indexing, lol. Thanks again.