It is not working for some reason? Please help if you can.
if v:FindFirstChild("6") then for _, v2 in pairs(v:GetChildren()) do if v2:FindFirstChild("BeamOne") then v2.BeamOne.Color = ColorSequence.new(Color3.fromRGB(Data.SlashColor2.Value), Color3.fromRGB(Data.SlashColor2.Value)) end if v2:FindFirstChild("BeamTwo") then v2.BeamTwo.Color = ColorSequence.new(Color3.fromRGB(Data.SlashColor3.Value), Color3.fromRGB(Data.SlashColor3.Value)) end if v2:FindFirstChild("BeamThree") then v2.BeamThree.Color = ColorSequence.new(Color3.fromRGB(Data.SlashColor4.Value), Color3.fromRGB(Data.SlashColor4.Value)) end end end
try this:
local v = script.Parent --// this Data table isnt needed since you have your own? its a way for me to debug the code local Data = { SlashColor2 = {Value = Color3.fromRGB(0,255,255)}, SlashColor3 = {Value = Color3.fromRGB(255,0,255)} , SlashColor4 = {Value = Color3.fromRGB(255,168,64)} } if v:FindFirstChild("6") then local Six = v["6"] if Six:FindFirstChild("BeamOne") then Six.BeamOne.Color = ColorSequence.new({ -- this would normally be something like --[[ Key: (Time to show color, The color to show ) ColorSequenceKeypoint.new(0 ,Color3.new(255,128,0), ColorSequenceKeypoint.new(0.5 ,Color3.new(255,128,255), ColorSequenceKeypoint.new(1 ,Color3.new(0,128,255) Also note you can have upto 15 color states any more than 15 and it will error ]] ColorSequenceKeypoint.new(0,Data.SlashColor2.Value), ColorSequenceKeypoint.new(1,Data.SlashColor2.Value) }) end if Six:FindFirstChild("BeamTwo") then Six.BeamTwo.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0,Data.SlashColor3.Value), ColorSequenceKeypoint.new(1,Data.SlashColor3.Value) }) end if Six:FindFirstChild("BeamThree") then Six.BeamThree.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0,Data.SlashColor4.Value), ColorSequenceKeypoint.new(1,Data.SlashColor4.Value) }) end end
Hope this helps! :)