It has to count the badges of the local player This belongs inside gui in a local script Inside a textlabel within too a NumberValue named "Ei" But this seems not to work. Whats wrong?
local player = game.Players.LocalPlayer
local BadgeService = game:GetService("BadgeService")
local badges = {229929415, 229929797}
function countBadges()
local Egg = script.Parent.Ei -- Name of NumberValue
local Eggs = 0
for _, badge in next, badges do
if BadgeService:UserHasBadge(player.UserId, badge) then
if Eggs == Eggs + 1 then
Egg = Egg.Value + 1
else
print ("fail")
end
end
end
return Eggs
end
while true do
countBadges()
script.Parent.Text = script.Parent.Ei.Value.."".."/2"
wait(0.5)
end
thank you
