Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Min is not a valid member of IntValue Max?

Asked by 3 years ago
                    local descendants = part.Drops:GetDescendants()
                    for index, descendant in pairs(descendants) do --error here
                        if descendant.Min and descendant.Max == true then
                            local randNum = math.random(descendant.Min.Value, descendant.Max.Value)
                            for count = randNum, randNum do
                                descendant:Clone()
                            end
                        end
                        --rest of non important code i guess

So its supposed to get descendants of the item drops of the item, stored in a group, which it does, but when i try to make another loop in the loop i get the error Min is not a valid member of IntValue "Workspace.Tree.Drops.WoodChunk.Max". How could i do this so it works?

2 answers

Log in to vote
1
Answered by 3 years ago

Your line 3, if descendant.Min and descendant.Max.Value == true then

you forgot the .Value

0
Nope, still not it. That line is to check that the IntValue (without the Value part) exists, not to check the value. WatsPlayzROBLOX 80 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Sorry for the late comment, i fixed the issue by myself some time ago. I had to use GetChildren, because GetDescendants gets even the children of the children

Answer this question