Trying to Clone Beams with Random Colors, but comes back as ColorSequence.new(): table expected

Hi! I’m trying to clone a part with a beam inside it. As I’m cloning the part with the beam, I want both of them (the part and beam) to change their color properties as soon as they are added into workspace.

I think the part changing color runs fine, but the beams in question comes back as an error saying ‘ColorSequence.new(): table expected.’ I’m using math.random to randomly get the rgb and the color sequence for the beams fyi.

I don’t know how to resolve this issue can someone please explain and help me?

Here is the code:

local ServerStorage = game:GetService("ServerStorage")
local interval = 5
local obj = script:WaitForChild("Ring")
local spawnOn = workspace.Baseplate

while spawnOn ~= nil do
	print("Spawned Ring")
	local r = math.random(1,255)
	local g = math.random(1,255)
	local b = math.random(1,255)

	local Yheight = math.random(200,500)
	local clone = obj:Clone()
	clone.Color = Color3.fromRGB(r, g, b)
	clone.Glow1.Color = ColorSequence.new(r, g, b)
	clone.Glow2.Color = ColorSequence.new(r, g, b)
	clone.Parent = workspace
	task.wait(interval)
end
1 Like

ColorSequence.new(r, g, b) should be ColorSequence.new(Color3.fromRGB(r, g, b))

1 Like

Wow thank you so much! Also Happy New Year :fireworks:

Did you accidentally type ColorSequence instead of Color3.new?

clone.Glow1.Color = ColorSequence.new(r, g, b)

Beams take a ColorSequence

Oh sorry, I thought the beam was a BasePart

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.