Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I script in a particle Emitter?

I've been trying to do this for a while now and it just breaks the script every time, am I doing anything wrong?

Here's what I have so far:

function weld(p0, p1, p)
    local weld = Instance.new("WeldConstraint")
    weld.Part0 = p0
    weld.Part1 = p1
    weld.Parent = p
end

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local root = character:WaitForChild("Head")

        if root then
            local newPart = Instance.new("Part")
			local Emitter = Instance.new("ParticleEmitter")
			Emitter.Texture = ("http://www.roblox.com/asset/?id=408371873")
			newPart.Transparency = 0
			newPart.Size = Vector3.new(0.2, 0.2, 0.2)
			newPart.CanCollide = false
            newPart.CFrame = root.CFrame * CFrame.new(0, -1.5, 0)
            newPart.Parent = workspace

            weld(root, newPart, root)
wait(10)
newPart.Transparency = 1
        end
    end)
end)

1 answer

That is quite simply because you are using () when setting the emitter's texture.

here is an example of a working script:

 local emitter = Instance.new('ParticleEmitter') 
emitter.Texture = "rbxassetid://301851161"

PS: Do not forget to set the emitter's parent to the part.

This discussion is preserved as it was. New answers, comments, and votes are closed.