I need help fixing a badge not awarding

Hello developers! I am starting to get stressed out with a game releasing in 12 days. I recently found out that this badge is not awarding. Here is the script:

local badgeser = game:GetService("BadgeService")
local marketplaceService = game:GetService("MarketplaceService")
local done = false

local mapName = "SpaceTurnpike"
local gold = 80
local silver = 65
local bronze = 50

game:GetService("ReplicatedStorage"):WaitForChild("WriteData").OnServerInvoke = function(player)
	if done == false then
		done = true
		player:WaitForChild("Times"):WaitForChild(mapName).Value = player:WaitForChild("PlayerGui"):WaitForChild("StopWatch"):WaitForChild("Window"):WaitForChild("Label").Text
		if player:WaitForChild("Times"):WaitForChild(mapName).Value <= 40 then
			badgeser:AwardBadge(player.UserId, 2124624904)
			player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + gold
			if marketplaceService:UserOwnsGamePassAsync(player.UserId, 12460579) then
				player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + gold
			end
			script.Disabled = true
		elseif player:WaitForChild("Times"):WaitForChild(mapName).Value >= 100 then
			badgeser:AwardBadge(player.UserId, 2124624907)
			player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + bronze
			if marketplaceService:UserOwnsGamePassAsync(player.UserId, 12460579) then
				player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + bronze
			end
			script.Disabled = true
		elseif player:WaitForChild("Times"):WaitForChild(mapName).Value > 41 then
			badgeser:AwardBadge(player.UserId, 2124624905)
			player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + silver
			if marketplaceService:UserOwnsGamePassAsync(player.UserId, 12460579) then
				player:WaitForChild("leaderstats"):WaitForChild("Points").Value = player:WaitForChild("leaderstats"):WaitForChild("Points").Value + silver
			end
			script.Disabled = true
		end
	end
end

Proof it doesn’t give badge:

Everything else in the script seems to be working just fine. I don’t get why it won’t award the badge.

If you can help, please let me know. Thanks, WE.

do you already own the badge? If you do it can’t be re-awarded

I don’t own the badge. It doesn’t make sense. I was testing in regular Roblox, and it used to work before…

Turns out, it was looking for a numbervalue and not a string. It was set to a string.