How do I prevent tools from being duplicated when another player that has a badge join? It keeps on duplicating my tools when players with the badge join the game.
I asked the discord for help, I want to see some answers here how to fix it.
local B = 2124521177;-- Badge id
game.Players.PlayerAdded:Connect(function(player)
game.Players.ChildAdded:Connect(function()
local Bad = game:GetService("BadgeService")
if Bad:UserHasBadgeAsync(player.userId, B) then
player:WaitForChild("StarterGear");
game.ReplicatedStorage.Basket:Clone().Parent = player.StarterGear;
game.ReplicatedStorage.Basket:Clone().Parent = player.Backpack;
end ;
end);
end);
