I keep getting this error and I don’t understand why. Can someone help me to fix this? Thanks.
function FindLevel()
for i, d in pairs(script.Parent:GetDescendants("CurrentLevel")) do
if d.Name == "CurrentLevel" then
for i, upg in pairs(upgrades) do
if d.Name == "Backpack" then
print(d.Name, upg.Name)
end
if d.Parent.Name == upg.Name then
local label = d
label.Text = string.gsub(label.Text, "_", upg.Value)
end
end
end
end
end
FindLevel()
for i, upg in pairs(upgrades) do
upg:GetPropertyChangedSignal("Value"):Connect(FindLevel())
end