Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I award all players a badge?

Hi. I have a boss, and I want it to award everyone a badge when it is killed. I have the script for when it dies, but I don't know how to award everyone the badge. My script is below.

local humanoid = script.Parent

		humanoid.Died:Connect(function()
			print("woah")
			end)

1 answer

local humanoid = script.Parent
local badgeID = 000000000 --Replace with your badge ID
humanoid.Died:Connect(function(plr)
	local a = game.Players:GetChildren()
	for i = 1,#a do
		if game:GetService("BadgeService"):UserHasBadgeAsync(a[i].UserId, badgeID)
			
		else
			game:GetService("BadgeService"):AwardBadge(a[i].UserId, badgeID)
		end
	end
end)

When your boss dies, the script will get all the players in the server, and award them the badge.
Regards, Vivilian9

This discussion is preserved as it was. New answers, comments, and votes are closed.