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

How can I make the sparkles lifetime to work properly?

Asked by 6 years ago

It doesnt change the lifetime in it, so I cannot make it,

 game.Workspace.ChildAdded:connect(function(player)
     local name = player.Name
     local playerinplayers = game.Players:FindFirstChild(player.Name)
     if playerinplayers ~= nil then
         playerinplayers.CanLoadCharacterAppearance = false
         local hat = Instance.new("Hat", player)
         hat.Name = "WhiteSparkleTimeFedora"
         hat.AttachmentForward = Vector3.new(0, 0, -1)
         hat.AttachmentPos = Vector3.new(0, -0.1, 0)
         hat.AttachmentRight = Vector3.new(1, 0, 0)
         hat.AttachmentUp = Vector3.new(0, 1, 0)
         local part = Instance.new("Part", hat)
         part.Name = "Handle"
         part.Size = Vector3.new(2,2,2)
         local mesh = Instance.new("SpecialMesh", part)
         mesh.MeshId = "rbxassetid://72081410"
         mesh.TextureId = "rbxassetid://1016192367"
         local particle =Instance.new ("ParticleEmitter", part)
         particle.Name = "SPARKLE"
         particle.Size = NumberSequence.new(0.3)
         particle.Transparency = NumberSequence.new(0.1)
         particle.LightEmission = 0
         particle.Color = 255, 255, 255
         particle.Acceleration = 0, 0, 0
         particle.Lifetime = NumberRange.new(0.1)
         particle.Speed = NumberSequence.new(1)
         particle.TextureId = ("rbxasset://textures/particles/sparkles_main.dds")
    end
end)
0
Maybe make it NumberRange.new(0.1, 0.2) since it's a range? Jxemes 75 — 6y
0
ahh so much deprecated stuff, setting parents before position, all the good old deprecated stuff. hiimgoodpack 2009 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

[EDIT] - My bad, I haven't looked over all of the script. So for the script you have a few basic errors. The basic errors are you are putting spaces, brackets, and . in the wrong place.

You are mostly using the instances in the wrong way. If you want to learn about how to use different instances, I suggest you use the wiki.

wiki.roblox.com/index.php?title=Instance_(Data_Structure)

game.Workspace.ChildAdded:connect(function(player)
     local name = player.Name
     local playerinplayers = game.Players:FindFirstChild(player.Name)
     if playerinplayers ~= nil then
         playerinplayers.CanLoadCharacterAppearance = false
         local hat = Instance.new("Hat", player)
         hat.Name = "WhiteSparkleTimeFedora"
         hat.AttachmentForward = Vector3.new(0, 0, -1)
         hat.AttachmentPos = Vector3.new(0, -0.1, 0)
         hat.AttachmentRight = Vector3.new(1, 0, 0)
         hat.AttachmentUp = Vector3.new(0, 1, 0)
         local part = Instance.new("Part", hat)
         part.Name = "Handle"
         part.Size = Vector3.new(2,2,2)
     part.BrickColor = BrickColor.new('color') -- Add a color.
     part.Transparency = 0 -- number
     part.Material = Plastic -- a material
     part.Anchored = false -- true or false, a boolvalue
     part.Shape = Block -- a shape
         local mesh = Instance.new("FileMesh", part) -- Make sure this is a filemesh instead of specialmesh because you are using id's.
         mesh.MeshId = "rbxassetid://72081410"
         mesh.TextureId = "rbxassetid://1016192367"
         local particle = Instance.new("ParticleEmitter", part)
         particle.Name = "SPARKLE"
         particle.Size = NumberSequence.new(0.3)
         particle.Transparency = NumberSequence.new(0.1)
         particle.LightEmission = 0
         particle.Color = 255, 255, 255
         particle.Acceleration = 0, 0, 0
         particle.Lifetime = NumberRange.new(0.1, number) -- For this after 0.1 add a comma, then add another number (the maximum)
         particle.Speed = NumberSequence.new(1)
         particle.TextureId = "rbxasset://textures/particles/sparkles_main.dds"
    end
end)

Hope this helps !

0
Thank you! I am just a starter on sceipting and this was not so easy script, and I didnt know. ItzFireable 17 — 6y
0
Didnt work. I will get it to work someday. ItzFireable 17 — 6y
0
hmm.. ill make another script lets see Amputea 2 — 6y
Ad

Answer this question