So I have a folder "Character" which stores a folder called Class
This Folder Stores:
- Other Folders
- A string value that's called "CharacterClassName"
It's very strange that I get the error below too, because when I do a print statement above the line where I get the error, it prints it perfectly. The print statement is:
print(CharacterFolder.Class.CharacterClassName.Value) print(CharacterFolder.Class.CharacterClassName.Name)
So for some reason I am getting this error:
02:23:44.107 - CharacterClassName is not a valid member of Folder
When I write this block of code:
-- Creates Character Folder
local function CreateNewCharacterFolder(player, ChosenClass)
local CharacterFolder = game.ServerStorage.Character:Clone()
CharacterFolder.Parent = player.PlayerDataFolder
CharacterFolder.Name = "Character "..CharacterNumberPresent
-- The lines where I get the error are below
CharacterFolder.Class.CharacterClassName.Name = ChosenClass
CharacterFolder.Class.CharacterClassName.Value = ChosenClass
end

5 comments
Read the wiki page for :WaitForChild() if you don't understand what it is.
Oh I’ll try that tomorrow when I wake up. I always forget about Waiting sometimes. Hopefully it works.
Yeah it makes sense too since print statements are read after the code is read through.
Arbritrary waits are never the solution. It simply hides the problem instead of fixing the solution and may not actually fix the solution
This was the right solution for this scenario, only because I cloned the values right before I tried to access them.