Hi.
What I am trying to do right now is that I want to match the Humanoid Root Part's position with the table of values I have.
If the value is matched with table, then it will break the while true do loop.
I don't think I can use generic for loop for this because I have to check 3 things simultaneously.
So how would I go on to do this?
I tried doing GetChildren() before hand but it gave me table error. I don't know how to do this. Please help me.
Here is my code if you do need it.
local TargetX = {
83, 84, 85, 86, 87, 88
}
local TargetY = {
3
}
local TargetZ = {
-94, -95, -96, -97, -98
}
while true do
local XPos = HumanoidRootPart.Position.X
local YPos = HumanoidRootPart.Position.Y
local ZPos = HumanoidRootPart.Position.Z
print(RoundNumber(XPos), RoundNumber(YPos), RoundNumber(ZPos))
wait()
local XChild = TargetX:GetChildren()
local YChild = TargetY:GetChildren()
local ZChild = TargetZ:GetChildren()
if RoundNumber(XPos) == XChild and RoundNumber(YPos) == YChild and RoundNumber(ZPos) == ZChild then
print("Match Found")
break
end
end
The RoundNumber is my rounding function. There is nothing wrong with that btw.

2 comments
You can try using coroutines maybe?
To solve this, You could make a function (or three, depends on your arguments) to look through each table. You can use a generic for loop to iterate through the table, then return true if any of the values is a match. To finish it off in your final if statement, put calls to each of the functions (or 1 function, depends on your arguments), separated with
and, and you'll be fine.