Issue with badge already collected notification [script + video]

Hello, for some time I’ve been trying to fix a problem I have with the notifications I receive when I “recollect” a badge I have already collected (find the game). What I would like is that when I touch the part (on which the badge is scripted) then the image of the creature and its name appear as a notification (so a custom notification for each badge). The problem I have is that when I touch the part, ALL the creatures appear instead of just one. I’ve tried a lot of scripts to fix this problem. I’ve added the most important lines from both scripts along with a video that shows the problem. If anyone can give me a lead to fix this problem? Thanks very much

--LocalScript in StarterCharacterScripts 
badgeCollected.OnClientEvent:Connect(function() --OnClientEvent after the FireClient
	for i,v in pairs(plr:WaitForChild("Creatures"):GetChildren()) do --Folder of all Creatures
			if game.StarterGui.ToutEstIci.Pedia.Pedi[v.Name] then --Starter GUI of all Creatures with same name
			
			   StarterGui:SetCore("SendNotification",{ --Notification
		       Title = "???", 
		       Text = "You have already found",
			   Icon = game.StarterGui.ToutEstIci.Pedia.Pedi[v.Name].Info.Image.Value, --The images that appear in the screen, it is a BoolValue
			   Duration = 3
          	   }) 
	   end	
    end
end)
--Server Script in Workspace
local function giveBadge(player,badgeId)
	local success, badgeInfo = pcall(function()
		return BadgeService:GetBadgeInfoAsync(badgeId)
	end)
	if success then
		if badgeInfo.IsEnabled then
			local success, result = pcall(function()
				BadgeService:AwardBadge(player.UserId, badgeId)
			end)
			if not result then --if player already have the badge then FireClient
				badgeCollected:FireClient(player)
			end
		end
	end
end

can anyone help me? Or give me some advice? I can send one or all of the scripts if it is necessary thank you

If anyone can give me a lead on how to fix this little problem?

Ok it’s good i find a way thanks

1 Like