I'm new to developing here, and I can't get this code to work after trying everything I could think of. So what I'm trying to make is a blood particle emitter enable after the character dies, so I started off by make a die function with the particles in the workspace, which worked:

local Blood1 = game.Workspace.BloodPart.Blood
local Blood2 = game.Workspace.BloodPart.BloodPart.Blood2
local Blood3 = game.Workspace.BloodPart.BloodPart.Blood3

game:GetService('Players').PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			Blood1.Enabled = true
			Blood2.Enabled = true
			Blood3.Enabled = true
			wait(1)
			Blood1.Enabled = false
			wait(0.5)
			Blood2.Enabled = false
			wait(0.5)
			Blood3.Enabled = false
		end)
	end)
end)

Then I attempted to put it in a StarterCharacter, which didn't work.

local Blood1 = game.StarterPlayer.StarterCharacter.BloodPart.Blood
local Blood2 = game.StarterPlayer.StarterCharacter.BloodPart.BloodPart.Blood2
local Blood3 = game.StarterPlayer.StarterCharacter.BloodPart.BloodPart.Blood3

I assume that this is the issue here, but I don't know how to make it so that it locates the part and particle emitters inside of a player.

The script is put in StarterCharacterScripts, and the part where the emitters are located are welded on to the torso of a "StarterCharacter" dummy.

2 comments

0

Are you using a LocalScript or a Server Script?

0

No, just a script.