I’ve come across an issue, when I get the error “<item> is not a valid member of <item>” even after I used a WaitForChild() in an if statematement.
What I’ve tried to do is the following:
ReplicatedStorage.Storage.Resources.ChildAdded:Connect(function(child)
if child:WaitForChild("Owner", 3600) and child.Owner.Value == country.Value and child.Parent then
-- do stuff
end
end)
I don’t understand where the error is coming from, as the full error states: Owner is not a valid member of <added-child>. - pointing to the line I have shown above.
ReplicatedStorage.Storage.Resources.ChildAdded:Connect(function(child)
local Owner = child:WaitForChild(“Owner”, 3600)
if Owner and Owner.Value == country.Value then
– do stuff
end
end)
Also checking child.Parent if it’s not nil is useless because it is in the “Resources” Instance already.