|
| 28 Nov 2017 11:54 AM |
I'm trying to make a script where a particle emitter appears for a small mount of time and then disappears. I have that part down. But I needed to put all of the values for the emitter's properties down and the color one is giving me trouble. Here's what I got:
E = Instance.new("Part") E.Name = ("explosion") E.Position = Po###-#####utlined above E.Parent = game.Workspace E.Transparency = 1 E.CanCollide = false W = Instance.new("ParticleEmitter",game.Workspace.explosion) --this *does* work W.Rate = 99999 W.Color = ColorSequence.new(Color3.new(34, 19, 1),Color3.new(0,0,0)) -- here's the issue. I want it to go from brownish to black. # W.Lifetime = NumberRange.new (4,4) W.Speed = NumberRange.new (100,130) W.SpreadAngle = Vector2.new (10,10) W.Acceleration = Vector3.new (0,-200,0) W.Texture = ("rbxgameasset://Images/Smoke") W.Size = NumberSequence.new (.37) script.Parent.Launcher.Explosion:Play() wait (3) W:Remove () All the rest works but when the 'explosion' goes off, the color is just gray like the default color. I'd highly appreciate help. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 11:55 AM |
| In line 5 about the position of the part, Pos is a variable outlined above. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 11:57 AM |
Color3.new() uses 0 - 1, if you want it to work heres what I suggest
do Color3.new(r/255,b/255,g/255) or Color3.fromRBG(r,g,b)
Color3.new() uses 0 - 1, 1 being white and 0 being black. if you want to use color3.new with things like 255, you will have to divide that number by 255 |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 11:59 AM |
Oh yea, just to point out whats probably causing the error:
W.Color = ColorSequence.new(Color3.new(34, 19, 1),Color3.new(0,0,0)) should either be
W.Color = ColorSequence.new(Color3.new(34/255, 19/255, 1/255),Color3.new(0,0,0)) or W.Color = ColorSequence.new(Color3.fromRGB(34, 19, 1),Color3.new(0,0,0)) |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 12:37 PM |
It's working now, thank you so much. I spent hours looking at wikis and forum posts! I'd gonna add this to my repetiore. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 01:37 PM |
You're welcome :P
(wow the ty made my day :D) |
|
|
| Report Abuse |
|
|