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

Help With onenter ParticleEmitter?

Asked by
iSvenDerp 233 Moderation Voter
8 years ago

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: '<name>' 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:)

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. iSvenDerp 233 — 8y
0
Edited answer. rexbit 707 — 8y

2 answers

Log in to vote
7
Answered by
rexbit 707 Moderation Voter
8 years ago

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)
0
It still doesnt work iSvenDerp 233 — 8y
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" Spongocardo 1991 — 8y
0
It still doesnt work:) iSvenDerp 233 — 8y
0
But thanks for helping:) iSvenDerp 233 — 8y
View all comments (4 more)
0
Thanks It works! Upvoted and accepted iSvenDerp 233 — 8y
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 iSvenDerp 233 — 8y
0
Thats because the Emitter's Size uses NumberSequences. rexbit 707 — 8y
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? iSvenDerp 233 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
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.

0
Line 3 would error, because character is defined after par was. rexbit 707 — 8y

Answer this question