Im trying to just use CollectionService to get parts,beams,trails,etc to color them rainbow.
somehow when im using Color3.fromHSV() it’s erroring saying “attempt to call a nil value”
Code:
local ColorSequence = {"Beam", "Trail"}
local Color3 = {"Part", "MeshPart", "PointLight", "SurfaceLight", "SpotLight"}
local x = 0
while true do
for index, tagged in game:GetService("CollectionService"):GetTagged("Rainbow") do
if table.find(Color3, tagged.ClassName) then
tagged.Color = Color3.fromHSV(x,1,1) -- error happens here
elseif table.find(ColorSequence, tagged.ClassName) then
tagged.Color = ColorSequence.new{
ColorSequenceKeypoint.new(0, Color3.fromHSV(x,1,1)),
ColorSequenceKeypoint.new(1, Color3.fromHSV(x,1,1))
}
end
end
x = x + .5/255
if x >= 1 then
x = 0
end
task.wait()
end
I’ve printed out
tagged,
tagged.Color,
Color3.fromHSV(x,1,1)
I’ve even just printed Color3.fromHSV(x,1,1) in the console and it doesnt error so im lost