I’m new to the dev forum, this is my first post. Thank you for understanding.
I’m currently a beginner scripter trying to figure out what I did wrong here. I’m trying to achieve a system in short that, you need a crystal saved in a folder in your player to change the color of a lightsaber.
if you need extra info, these are solarhorizons lightsabers, available open-sourced.
in the tools server script, there is a function called recolor. I am modifying it here.
Recolor = function(data,plr)
local TargetBlade
if Dual then
TargetBlade = {
[1] = ActiveSabers[1].Blade,
}
if ActiveSabers[2] then
TargetBlade[2] = ActiveSabers[2].Blade
end
else
TargetBlade = Blades
end
for _, Blade in next, TargetBlade do
local Target = "Emitter"
if Blade.Name == "Blade2" then
Target = "Emitter2"
end
Blade.FX.Glow.Color = data.Outer
for _, v in next, Blade[Target]:GetChildren() do
if data[v.Name] then
if plr:FindFirstChild("Crystals"):FindFirstChild("Green") then
v.Color = ColorSequence.new(data[v.Name])
end
else
v.Color = ColorSequence.new(data.Outer, data.Inner)
end
end
end
end,
it uses a module script to get color data and keys, if I pressed g the lightsaber would turn green.
this is where the problem lies. when I modified it, I got the error that states:
this is the error, ive narrowed it down to the part I’ve added which is this line (i think)
if plr:FindFirstChild("Crystals"):FindFirstChild("Green") then
the green crystal is a bool value in a folder in my player. there will be other colors in there too.
I am still new and do not understand a lot of things. explaining it simply would help alot, and if you have questions you can ask. thanks alot!
