Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can anyone help me figure out why FindFirstChild always returns nil?

local folder = game.Workspace:FindFirstChild("Invisiblity Folder")
	if folder==nil then
		newfolder = Instance.new("Folder")
		newfolder.Parent=game.Workspace
		newfolder.Name="Invisibility Folder"
		print("made folder")
	else
			print("folder here")
	end

It creates a brand new folder everytime I run this code, even if a folder is already in the workspace. Anyone understand why? Running from a Server-Side script.

1 comment

0

the folder may not be loaded in yet and so the script creates a new folder and then the original folder eventually loads in, try WaitForChild()

1 answer

✓ Accepted answer

You made a typo in Invisibility on your first line, you wrote Invisiblity but the folder you are creating is named Invisibility

1 comment

0

Jeez. Thank you very much.

This discussion is preserved as it was. New answers, comments, and votes are closed.