Clicktool check badge (not working)

is it possible to check if the player has the badge, using the clickdetector to give the tool, if he has the badge?
I made this, but is not working. the script works normally without the check badge. but I need to check

local BadgeService = game:GetService("BadgeService")
Toolname2 = "sword"

function give(Player)
	if BadgeService:UserHasBadgeAsync(Player.UserId,2124605681) then
	if not Player.Backpack:FindFirstChild(Toolname2) then
		local Tool = game.ServerStorage[Toolname2]:clone()
		Tool.Parent = Player.Character
		end
	end
end
script.Parent.ClickDetector.MouseClick:connect(give)

If you said that it worked before you added this, then it could be that you added the wrong badge id? try printing out the result of BadgeService:UserHasBadgeAsync(Player.UserId,2124605681)

I’m laughing at myself. I was testing on an alternate place. so it wasn’t working. Thanks

1 Like

Ohh, I see haha. At least you eventually discovered your problem! If you hae anymore issues don’t be afraid to make another post!