im trying to do a check for a value inside a for loop, the answer is most likely simple but heres what i have
the error is on the "if not v.OverlapCheck then" line. it says OverlapCheck is not a valid member of model
if not v.OverlapCheck then
--------------------------------------
local checkforoverlap = Instance.new("Vector3Value")
checkforoverlap.Parent = v
checkforoverlap.Value = v.Floor.Position
checkforoverlap.Name = "OverlapCheck"
print("v has overlap checker")
---------------------------------------
for x, overcheck in pairs(worldu:GetChildren()) do
if overcheck.OverlapCheck then
if overcheck.OverlapCheck.Value.X == v.OverlapCheck.Value.X then
if overcheck.OverlapCheck.Value.Y < v.OverlapCheck.Value.Y then
print("Overlap Found")
v:Destroy()
end
end
end
end
end
-------------------------------------------------

3 comments
you mean to stop the script from running until it finds the child with the name you want? you use :WaitForChild("itemnamehere") for that
no i mean the script gives an error on the "if not v.OverlapCheck" line saying its not a valid member of model
i figured it out, your answer wasnt it but it was close. it was actually FindFirstChild() post that as an answer and ill give you credit anyway.