How do you check for an item in a model without the script giving an error?[Closed]
Asked by
8 years ago Edited 8 years ago
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
01 | if not v.OverlapCheck then |
03 | local checkforoverlap = Instance.new( "Vector3Value" ) |
04 | checkforoverlap.Parent = v |
05 | checkforoverlap.Value = v.Floor.Position |
06 | checkforoverlap.Name = "OverlapCheck" |
07 | print ( "v has overlap checker" ) |
09 | for x, overcheck in pairs (worldu:GetChildren()) do |
10 | if overcheck.OverlapCheck then |
11 | if overcheck.OverlapCheck.Value.X = = v.OverlapCheck.Value.X then |
12 | if overcheck.OverlapCheck.Value.Y < v.OverlapCheck.Value.Y then |
13 | print ( "Overlap Found" ) |