i am trying to make a script that finds number values named "Damage" but when roblox looks in the wrong folder it says attempt to call a nil value and stops the rest of the script
note: I am only going to show a certain part of the script
button.MouseButton1Click:Connect(function(button_1_clicked)
answer_box.Position = UDim2.new(0, 0, 0, 0)
answer_box.Transparency = 0
--find damage value
local objects = game.Workspace:GetChildren()
for i, child in ipairs(objects) do
local childs_children = child:GetChildren()
local config = childs_children:FindFirstChildOfClass("Configuration")
local damage_value = config:FindFirstChild("Damage")
if damage_value then
local found_value = instance.new("ObjectValue")
found_value.Name = "damage_found"
found_value.Parent = button
found_value.Value = damage_value
end
end
end)

1 comment
What line is the error on?