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

How do you use Color3?

Asked by 10 years ago

I'm making a script in where you press 'z' a fire is inserted into your torso; in other words, a KeyDown event. But I've never used Color3, a property of 'Fire'. All I've used is BrickColor Heres my script:


fire = Instance.new("Fire") fire.Name = "fire" fire.Parent = Torso fire.Size = 25 fire.Heat = 30 fire.Color = Color.new(0,0,0) end end end mouse.KeyDown:connect(onPressed)

I didn't post the other half of the script, which is basically the beginning of it, 'cause, it works out fine.

2 answers

Log in to vote
5
Answered by
Redbullusa 1580 Moderation Voter
10 years ago

If you inserted a Fire object and adjusted the color to your choice, you can then use the value to script the colors you want.

Say you want a cyan color, and your Color3Value that you want is this: (87, 209, 236).

To adjust it, use this formula:

[Object].[Property] = [Constructor]([ValueRed], [ValueGreen], [ValueBlue])

fire.Color = Color3.new(87/255, 209/255, 236/255)

Now, I know what you're thinking. Why the heck am I dividing each number by 255??

Well, it's because each element of the value ranges from 0-1 (which makes 255/255 = 1).

So each number can not go over 1 (unless if you want to make it to 1 (white)).

Ad
Log in to vote
1
Answered by 10 years ago

Change that "Color.new" to "Color3.new"

Answer this question