i got a problem on making table thing
In short, this style of script makes this result.
local Table = {{{1,1},{1,2}},{{2,1},{2,2}}}
table.insert(Table[2], {3,3})
print(Table)
{
[1] = ▼ {
[1] = ▼ {
[1] = 1,
[2] = 1
},
[2] = ▼ {
[1] = 1,
[2] = 2
}
[3] = ▼ {
[1] = 3,
[2] = 3
}
},
[2] = ▼ {
[1] = ▼ {
[1] = 1,
[2] = 1
},
[2] = ▼ {
[1] = 1,
[2] = 2
},
[3] = ▼ {
[1] = 3,
[2] = 3
}
}
}
well, yes. the script not print this. so i said “this style of script”
here is the script causing bug
for i = 1, XDirection, 1 do
print("right1",Num, PathFinding[Num], PathFinding[1])
table.insert(PathFinding[Num], {LastPath[1], LastPath[2]+i})
print("right2",Num, PathFinding[Num], PathFinding[1])
end
same style of script. right?
so it prints
00:22:27.361 right1 2 ▼ {
[1] = ▼ {
[1] = 3,
[2] = 6
}
} ▼ {
[1] = ▼ {
[1] = 3,
[2] = 6
}
} - Client - GameWork:468
00:22:27.361 right2 2 ▼ {
[1] = ▼ {
[1] = 3,
[2] = 6
},
[2] = ▼ {
[1] = 3,
[2] = 7
}
} ▼ {
[1] = ▼ {
[1] = 3,
[2] = 6
},
[2] = ▼ {
[1] = 3,
[2] = 7
}
} - Client - GameWork:470
so, problem is Item that must only be put in one table got put in two tables.
this problem happens even i use PathFinding[Num][#PathFinding[Num]+1] = {LastPath[1], LastPath[2]+i}