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

Why am I getting the 'Getchildren is not a valid member of Folder' error?

Asked by 3 years ago
Edited 3 years ago

So I am getting the error 'Getchildren is not a valid member of Folder' in this line of code

elseif #mapVoteFolder:GetChildren() == #highestVoted:GetChildren() then

From this loop

for i, mapVoteFolder in pairs(mapVotesFolder:GetChildren()) do
        if not highestVoted then highestVoted = mapVoteFolder end

        if #mapVoteFolder:GetChildren() > #highestVoted:GetChildren() then

            highestVoted = mapVoteFolder 

        elseif #mapVoteFolder:GetChildren() == #highestVoted:GetChildren() then

            local mapsToChoose = {mapVoteFolder, highestVoted}
            highestVoted = mapsToChoose[math.random(#mapsToChoose)]
        end
    end

Is it because of something inside the folder not being there or because of something inside my script? Thanks in advance

1
case sensitive, use capital C for the Children bpanasider 39 — 3y

Answer this question