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

FindFirstChild is not a valid member of workspace error for no reason?

I was looking at a Region3 roblox scripting tutorial and when i was tryping the script i finished it then i clicked play it show the error of "FindFirstChild is not a valid member of workspace".

Here is my script

local region = Region3.new(Vector3.new(5,0,5), Vector3.new(15,15,15))

local part = Instance.new("Part")
part.Anchored = true
part.Size = region.Size
part.Parent = game.Workspace
part.CanCollide = false
part.Transparency = 0.9


while true do
	wait()
	local thingsinRegion = workspace:FindPartsInRegion3(region, part, 1000)
	for i, part in pairs (thingsinRegion)do
		if part.Parent:findFirstchild("Humanoid") ~= nil then 
			print("Player found in the region")
			local playername = part.Parent.Name
		end
	end
end

2 answers

I'm not 100% sure, but in line 15, you used ':findFirstChild' when it should be ':FindFirstChild'.

In line 15, you used :findFirstChild instead of :FindFirstChild.

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