Attempt to index nil with Enabled

Hi there,

I ran into this issue

Here’s my code.

	elseif Arg == "ProductPurchased" then
		script.Parent.MainShop.PurchaseRobux.Visible = false
		script.Parent.MainShop.PurchaseBackpack.Visible = false
		script.Parent.MainShop.Backpacks.Open.Visible = true
		script.Parent.MainShop.Robux.Open.Visible = true
		script.Parent.MainShop.Visible = false
		Player.Character.Head:FindFirstChild("WhiteParticle").Enabled = true --Error line
		Player.Character.Head:FindFirstChild("MoneyParticle").Enabled = true
		Player.Character.Head:FindFirstChild("WhiteParticle").Enabled = false
		Player.Character.Head:FindFirstChild("MoneyParticle").Enabled = false

Weird thing is, I am adding the particles as soon as the player joins, but they just don’t add?

		repeat wait() until Candy and Money 
		--Put particle emitter in HumanoidRootPart
		local s, e = pcall(function()
			local particle = ReplicatedStorage:FindFirstChild("WhiteParticle")
			local particle2 = ReplicatedStorage:FindFirstChild("MoneyParticle")
			particle:Clone().Parent = Character.Head
			particle2:Clone().Parent = Character.Head
		if not s then


Any fix? I really don’t know how to fix it

Use WaitForChild instead of FindFirstChild in the first script? Or is there a reason you’re using that

Any chance it gets stuck on the repeat wait() until Candy and Money line?

I’ve been teached to not use any :WaitForChild() or :FindFirstChild() if you’re 100% sure it’s already there

Wait. GOod point. It seems like it does get stuck there.

You can check by putting a print right after it and seeing if it prints.

It seems to appear that the Humanoid.Died check broke, and that the script only works whenever you die? Huh?

My script only works whenever you have died atleast 1 time before. This is so weird.