local function Move()
ReachedToDest.Value = false
script.Parent.Humanoid:MoveTo(TargetNode.Value.Position)
script.Parent.Humanoid.MoveToFinished:Wait()
ReachedToDest.Value = true
for _, V in pairs(TargetNode.Value.Targetable:GetChildren()) do
if V.Name == "One" then
Nodess.Node1 = V.Value
elseif V.Name == "Two" then
Nodess.Node2 = V.Value
elseif V.Name == "Three" then
Nodess.Node3 = V.Value
elseif V.Name == "Four" then
Nodess.Node4 = V.Value
end
end
print(Nodess)
local Found = false
while Found == false do
TargetNode.Value = Nodess[math.random(1, 4)]
if TargetNode.Value == nil then
Found = false
print("Not Found")
else
Found = true
print("Found")
end
task.wait()
end
end
The only part having issues rn is the bottom, where i do the math.random in the table.
It apparently cant find anything in the table event though when i print the table it has things in it