(SOLVED)Help with group badge

  1. What do you want to achieve? A badge for joining my group

  2. What is the issue? Cannot find anything on how to do this i’ve been looking for awhile and cant find anything about it and I know basiclly nothing about scripting and its hard for me to create scripts with no help because I am so new to creating roblox games

  3. What solutions have you tried so far? As stated in number 2 i have looked for awhile and still cannot find anything nor figure it out on my own i have had many problems with badges in the past

do you want to check if the player is in your group when joining the game? if so

local YourGroupID = 0
local YourBadgeID = 0
game.Players.PlayerAdded:Connect(function(plr)
if not plr:IsInGroup(YourGroupID) then return end
if game:GetService("BadgeService"):UserHasBadge(plr.UserId,YourBadgeID) then return end
game:GetService("BadgeService"):AwardBadge(plr.UserId,YourBadgeID)
end)

Just noting that you’d want to use BadgeService to award badges instead of the player, so code would probably look like this:

local BadgeService = game:GetService("BadgeService")

local YourGroupID = 0
local YourBadgeID = 0

game.Players.PlayerAdded:Connect(function(plr)
    if not BadgeService:UserHasBadge(plr.UserId, YourBadgeID) and plr:IsInGroup(YourGroupID) then
        BadgeService:AwardBadge(plr.UserId,YourBadgeID)
    end
end)

Put in a script in ServerScriptService, and replace YourBadgeID and YourGroupID with the correct IDs!

All the scripts above are helpful, but if you want to award a badge from the Roblox webpage by joining your group, you could find an API but I don’t think that is possible

I miswrote plr over BadgeService.