i recently made a global cooldown for tools, which never resets when player character is reset. while i did that, i also made a visual gui that indicates current tool cooling down with a timer
everything was fine, until when i wrote a script that copies template to player’s cooldownfolder (where stores all tools’ cooldowns) and tested it, it gave me this error, “child is not a valid member of parent”,
although all children’s were existing inside the object, and all of the scripts i wrote were really fine
local CooldownFolder = Player:WaitForChild("CooldownFolder")
if #CooldownFolder:GetChildren() > 0 then
for _, v in pairs(CooldownFolder:GetChildren()) do
OnCooldownAdded(v)
end
end
CooldownFolder.ChildAdded:Connect(OnCooldownAdded)