generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help on scripting a particle's color

Previous Thread :: Next Thread 
Chamberlaine is online. Chamberlaine
Joined: 12 Oct 2013
Total Posts: 31
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
Chamberlaine is online. Chamberlaine
Joined: 12 Oct 2013
Total Posts: 31
28 Nov 2017 11:55 AM
In line 5 about the position of the part, Pos is a variable outlined above.
Report Abuse
NodaDuck45 is online. NodaDuck45
Joined: 14 Sep 2017
Total Posts: 47
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
NodaDuck45 is online. NodaDuck45
Joined: 14 Sep 2017
Total Posts: 47
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
Chamberlaine is online. Chamberlaine
Joined: 12 Oct 2013
Total Posts: 31
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
NodaDuck45 is online. NodaDuck45
Joined: 14 Sep 2017
Total Posts: 47
28 Nov 2017 01:37 PM
You're welcome :P


(wow the ty made my day :D)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image