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

Help With onenter ParticleEmitter?

Hi so.. My script is just testing my onEnter particle emitter script. Its supposed to work and insert a particle emettir for 5 seconds when u enter the game. 12:51:00.939 - Workspace.Particle Emitter:6: '' expected near '/' Thats the error. The output shows.

Par = Instance.new("ParticleEmitter", character)


game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		Par.Texture = http://www.roblox.com/Fire-item?id=32312686
		wait(5)
		:Destroy()
		
	end)
end)

Help would be appreciated thanks in advance:)

2 comments

0

Thanks y'all I'm on mobile so I can't test it now but when can get on PC I'll test it.

0

Edited answer.

2 answers

✓ Accepted answer

You forgot to place quotation marks around your Id, And you have :Destroyin a undefined way, You must define what you are going to destroy, The third thing that will error is your ParticleEmitter Instance variable, you are placing it in character, and character hasn't been defined till player.CharacterAdded, this will give a Global error.

Id = "Id Here"

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
		Par = Instance.new("ParticleEmitter", character.Torso)
        Par.Texture = "rbxasset://"..Id
        wait(5)
        Par:Destroy()
    end)
end)

8 comments

0

It still doesnt work

0

You need to use the asset link on line 4, so it should be "rbxassetid://32312686", or it can be "http://www.roblox.com/asset/?id=32312686"

0

It still doesnt work:)

0

But thanks for helping:)

0

Thanks It works! Upvoted and accepted

0

Thanks again but when i use the other properties like Par.Texture and Par.Size it never ends but if i just use Par.Texture it ends

0

Thats because the Emitter's Size uses NumberSequences.

0

Not asking for u to to anything but is there a way I can still use the emitters size an make it end eventullay?

Par = Instance.new("ParticleEmitter", character)


game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        Par.Texture = "http://www.roblox.com/Fire-item?id=32312686" 
        wait(5)
        Par:Destroy()

    end)
end)

Also, I prefer to use variables for ID's, so I would do it such as..

local particleId = 32312686

Par = Instance.new("ParticleEmitter", character)


game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        Par.Texture = "http://www.roblox.com/Fire-item?id=" .. particleId
        wait(5)
        Par:Destroy()

    end)
end)

That way, you can change the Id anytime you want easily.

1 comment

0

Line 3 would error, because character is defined after par was.

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