I'm working on a game, and I'm making the final boss. I want it so when the boss dies, it awards a badge. Problem is, I'm terrible at scripting and it's not working as intended, though I've referenced many wiki pages.
local humanoid = script.Parent
local BadgeService = game:GetService("BadgeService")
while true do
if humanoid.Health < 1 then
BadgeService:AwardBadge(2124549136)
print ("Beat Game")
end
end
Additional info: Localscript inside of Humanoid of an NPC If you could help, it would be greatly appreciated.

1 comment
Your while loop will hang, causing a crash. You can simply just use a yielding signal: Humanoid.Died