Declaring a variable of a folder inside a folder

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    Declaring a variable of a folder inside a folder

  2. What is the issue?
    Output keeps saying that
    image

–My Code

local ServerStorage = game:GetService("ServerStorage")
local Challenges = ServerStorage:WaitForChild("Challenges"):GetChildren()
local DigOrDie = Challenges:WaitForChild("DigOrDie"):GetChildren()

–My Explorer Tab
image

–I’ve gone in play test and the folder is in the same location so I’m confused on why it keeps returning a nil

1 Like

Can’t you just do:

local challenges = ServerStorage:WaitForChild("Challenges")
local digOrDie = challenges:WaitForChild("DigOrDie")
2 Likes

you’re calling WaitForChild() on a table on line 3 returned by GetChildren() on line 2. Remove it from the end of line 2 and it should be good.

2 Likes