Update 1:
Now I think it works, but I have a little bug. Some users getting the badge and some no.
Update 2:
The script works right now, but if I put it in the egg launcher is delayed and Idk why.
As well as I suggest running the following function to award a badge (this is found on the BadgeService:AwardBadge page):
local BadgeService = game:GetService("BadgeService")
local function awardBadge(player, badgeId)
-- Fetch badge information
local success, badgeInfo = pcall(function()
return BadgeService:GetBadgeInfoAsync(badgeId)
end)
if success then
-- Confirm that badge can be awarded
if badgeInfo.IsEnabled then
-- Award badge
local awarded, errorMessage = pcall(function()
BadgeService:AwardBadge(player.UserId, badgeId)
end)
if not awarded then
warn("Error while awarding badge:", errorMessage)
end
end
else
warn("Error while fetching badge info!")
end
end
local BadgeService = game:GetService("BadgeService")
local ID = 2124713368
local Part = script.Parent
local PartCooldown = false
print("Script should be online?")
Part.Touched:Connect(function(Hit)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
print("Part Touched")
if Player and PartCooldown == false then
PartCooldown = true
print("Part Touched by a Player")
if not BadgeService:UserHasBadgeAsync(Player.UserId, ID) then
BadgeService:AwardBadge(Player.UserId, ID)
print(Player.Name.." has been awarded this badge!")
else
warn(Player.Name.." already has this badge!")
end
wait(1)
PartCooldown = false
end
end)
Honestly I have no clue, if your badges are delaying on rewarding to other players then it might be a bug of some sort? It might also depend on how much objects you have in your game, but I highly doubt that
Do some sanity checks to confirm the issue that’s happening, then message @Bug-Support to see if they could fix the issue
You could also create a new place, but that’d waste you another 100 robux so idk