Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

For some reason when using color3.new it is multiplying?

local red = game.Workspace.Red
local light = script.Parent:FindFirstChild("Sector 1 Light")

red.Changed:Connect(function()
    if red.Value == true then
        light.BrickColor = BrickColor.new("Crimson")
		light.SurfaceLight.Color = Color3.new(255, 37, 40)
		wait(1)
	else
		light.brickColor = BrickColor.new("Institutional white")
		light.SurfaceLight.Color = Color3.new(255, 255, 255)
    end
end)

So whenever I try to set the color, instead of it setting it, it multiplies it by the previous color.. WHAT THE HECK??

It is happening on the first if statement, not the else. At least I don't think..

Please help.

1 answer

✓ Accepted answer

Color3.new accepts a range from 0 to 1 Example:

Color3.new(1,0,0) --Red

What you want to use is Color3.fromRGB

This accepts a range from 0 to 255

Color3.fromRGB(255,0,0) --Red

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.