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.
instead of constantly checking you can bind an event like
humanoid.Died:Connect(function() BadgeService:AwardBadge(2124549136) print ("Beat Game") end)
also you probably want to make it a server script