My bag giver script isn't working all the time, any help?

I have this bag giver script and it doesn’t work, anyone help me with this, sometimes when I load it, I will see it just fall through the world, and then sometimes it will stay on my character, I want a permenant solution to this, anyone help? here is the script.

local BlackBag = game.ServerStorage.Bags.BlackBag
  
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
	if player:WaitForChild("leaderstats").Bag.Value == 1 then
		wait(1.5)
		local newRadio = BlackBag:Clone()
		newRadio.Parent = character
        newRadio.CFrame = character:WaitForChild("UpperTorso").CFrame * CFrame.Angles(0,3.14,6) -- or Torso if you use R6
		local weld = Instance.new("Weld") 
		weld.Part0 = newRadio
		weld.Part1 = character:WaitForChild("UpperTorso")
		weld.C0 = newRadio.CFrame:inverse() 
		weld.C1 = character:WaitForChild("UpperTorso").CFrame:inverse() 
		weld.Parent = newRadio	
		print("Black Bag Successfully Given")
    end
	end)
	end)

could you post a screenshot of what it should look like?

and a potential issue is that the if then statement is only executed each time the character is (re)loaded, not each time the Bag value changes, and why must the bag value equal 1? what if they have a bit more?

If they have a bit more, they dont get the bag, and I will try to provide a screenshot.

Sorry, I cannot provide a screenshot.

Is it a local script of server script, are you using and events?

Consider following options:

  • Turning the BlackBag’s Massless on all descendants(that is a BasePart)
  • Turning BlackBag into an accessory that uses the BackAttachment on the character.
    • Requires Humanoid:AddAccessory(accessory).
    • Requires an attachment named BackAttachment on the bag.
    • No weld required.
    • No CFrame required.
    • If you plan on switching the bag, destroy the old bag.