Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I script in a particle Emitter?

Asked by 5 years ago

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

Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
5 years ago
Edited 5 years ago

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.

Ad

Answer this question