[Name] is not a valid member of Folder

Hey there.

I’ve been working on a fan-game of a well-known “Find the _” game, Find the Little Guys. The way my game is currently scripted uses a model/kit by @K1ndaConfused, “THE REGGIEPEDIA!!”. I’ve used it in tons of other games and have made a lot of edits to it over the years. For this game in particular I’ve edited it to resemble the littlepedia from the original Find the Little Guys.

However, I’ve started running into a strange issue with the littlepedia. Sometimes, for no apparent reason at all, it will claim that one of the little guys is " not a valid member of Folder “Workspace.Badges (Guys)” "


Naturally, I checked to see if he was still in the folder. Had I forgotten to anchor him, making him fall through the map and into the void?

… Nope. He’s still there, and nothing has changed about the part.

This game does use the JToH kit, so I tried removing that to see if it was the cause, and it continued to happen. I tried changing various properties about the guys, and still nothing.

By far the most frustrating thing about this strange problem is how inconsistent it is. It only happens around 25% of the time, and which guy it’s erroring on varies as well. This issue, when it occurs, literally makes the game unplayable, as the littlepedia will not open and you will not receive any badges for collecting the guys.

Here’s a link to both kits, the original by K1ndaConfused and my tweaked one (the one in use here is the edited version, if that wasn’t already clear):

Some of the scripts that make the littlepedia function:
(GUIs):

local Players = game:GetService("Players")
local localplayer = Players.LocalPlayer
local CoreGui = game:GetService("StarterGui")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local dexgrid = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Dex"):WaitForChild("Dex"):WaitForChild("Dex")
local DetailedInfo = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Dex"):WaitForChild("Dex"):WaitForChild("DetailedInfo")
local OpenMenu = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Dex"):WaitForChild("Open")
local AwardBadge = game.ReplicatedStorage:WaitForChild("AwardBadge")
local open = false
local ReggieInfo = require(ReplicatedStorage.GuyInfo)

templateitem = dexgrid.Reggie
for i, v in pairs(ReggieInfo) do
	local copy = templateitem:Clone()
	copy.Name = i
	copy.LayoutOrder = v[1]
	copy.Parent = dexgrid
	copy.Title.Text = v[2]
	copy.ImageButton.Image = v[3]
	if v[6] == "ez" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(75, 151, 75)
	elseif v[6] == "mid" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(200, 168, 51)
	elseif v[6] == "mildly infuriating" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
	elseif v[6] == "takis" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(9, 9, 9)
	elseif v[6] == "mental state" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(31, 31, 172)
	elseif v[6] == "Extreme" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(60, 141, 207)
	elseif v[6] == "TERRIFYING" then
		copy.DifficultyColor.BackgroundColor3 = Color3.fromRGB(62, 255, 255)
	elseif v[6] == "MINDBOGGLING" then
		copy.DifficultyColor.Image2.Image = 'rbxassetid://10491646858'
	elseif v[6] == "101" then
		copy.DifficultyColor.Image2.Image = 'rbxassetid://15695434986'
	end
	
	
	
	
	
	
	copy.ImageButton.MouseButton1Click:Connect(function()
		DetailedInfo.KotName.Text = v[2]
		DetailedInfo.ImageFrame.ImageLabel.Image = v[3]
		DetailedInfo.Description.Text = v[4]
		DetailedInfo.Hint.Text = "hint: " .. v[5]
		DetailedInfo.DifficultyName.Text = v[6]
		DetailedInfo.MadeBy.Text = "made by @" .. v[7]
		DetailedInfo.Area.Text = v[8]
		if v[8] == "spawn" then
			DetailedInfo.Area.BackgroundColor3 = Color3.fromRGB(75, 151, 75)
		elseif v[8] == "mixed" then
			DetailedInfo.Area.BackgroundColor3 = Color3.fromRGB(27, 27, 29)
		elseif v[8] == "anywhere" then
			DetailedInfo.Area.BackgroundColor3 = Color3.fromRGB(17, 40, 48)
		elseif v[8] == "offgame" then
			DetailedInfo.Area.BackgroundColor3 = Color3.fromRGB(17, 40, 46)
		end
		DetailedInfo.Visible = true
		dexgrid.Visible = false
		if v[6] == "ez" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(75, 151, 75)
		elseif v[6] == "mid" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(200, 168, 51)
		elseif v[6] == "mildly infuriating" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
		elseif v[6] == "takis" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(9, 9, 9)
		elseif v[6] == "mental state" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(31, 31, 172)
		elseif v[6] == "Extreme" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(60, 141, 207)
		elseif v[6] == "TERRIFYING" then
			DetailedInfo.DifficultyName.BackgroundColor3 = Color3.fromRGB(62, 255, 255)
		end
	end)
	
	local debounce = false
	
	workspace["Badges (Guys)"][i].Touched:Connect(function(itemThatTouchedPart)
		local playerCheck = Players:GetPlayerFromCharacter(itemThatTouchedPart.Parent) 
		if playerCheck and playerCheck == localplayer then
			if debounce == false then
				debounce = true

				CoreGui:SetCore("SendNotification", {
					Title = v[2];
					Text = "you already found this guy";
					Icon = v[3];
					Duration = 3;
				})
				AwardBadge:FireServer(v[9])

				wait(5)
				debounce = false
			end
		end
	end)
	
end
templateitem:Destroy()

DetailedInfo.TextButton.MouseButton1Click:Connect(function()
	dexgrid.Visible = true
	DetailedInfo.Visible = false
end)

OpenMenu.MouseButton1Click:Connect(function()
	open = not open
	if open == false then
		dexgrid.Parent.Visible = false
	else
		dexgrid.Parent.Visible = true
	end
end)

(GuyInfo):


local GuyInfo = {}
local count = 1

--order: layoutorder in gui, Name, AssetID(image), Description, Hint, Difficulty, badgeid

--Easy
GuyInfo["little guy but bad"] = {count, 'little guy but bad', 'rbxassetid://73063476760460', "very poorly drawn guy", 'right there', 'ez', 'MiningPiggie', 'spawn', 2716203596649984}
count += 1

GuyInfo["suspicious guy"] = {count, 'suspicious guy', 'rbxassetid://138916595494572', "there is a little guy among us", 'i saw him vent', 'ez', 'MiningPiggie', 'spawn', 2107264873037548}
count += 1
--Medium
--Hard
GuyInfo["drip guy"] = {count, 'drip guy', 'rbxassetid://89894603423802', "i was going to write 'he got that drip' but then i realized that's what wet guy's description is ", 'hanging out in the shed, but you need "drip" to enter...', 'mildly infuriating', 'MiningPiggie', 'spawn', 3587560288862026}
count += 1
--Intense
--Insane
GuyInfo["nerdy guy"] = {count, 'smart guy', 'rbxassetid://124081744966395', "if you figured this out then you're a smart guy", "somebody vandalized the conspiracy board with a bunch of math problems!!", 'mental state', 'MiningPiggie', 'spawn', 1439800887682023}
count += 1
--Extreme



return GuyInfo

I’d much appreciate any help with this, I don’t think I’ve ever been so baffled by a scripting issue before.

1 Like

If it helps, the specific line it’s erroring on seems to be line 83 of GUIs.

workspace["Badges (Guys)"][i].Touched:Connect(function(itemThatTouchedPart)

TL; DR: just replace workspace["Badges (Guys)"][i] with workspace:WaitForChild("Badges (Guys)"):WaitForChild(i)

From what I see, I would recommend adding yields such as :WaitForChild(INSTANCE_NAME: string) to ensure the instance has loaded. Since your script is local-side, maybe the instance under workspace isn’t yet replicated.

1 Like

Maybe try using Waitforchild, since it’s client:

workspace["Badges (Guys)"]:WaitForChild(i).Touched:Connect(function(itemThatTouchedPart)
1 Like

Seems like that fixed it! Thank you both so much for your help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.