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 -------------------------------------------------
ohh. i thought you meant it didnt exist yet. which is what WaitForChild is for.