LUA Script - for do issue --SOLVED


#1

Hi everyone,
I’m new to lua script, but not new to different other programming languages. Here’s my finding:
That script WORKS:

Offset={0, 0, 0, 0}
CorX=-50

–for u=1,5,1
–do
for i=1,5,1
do
MovJ(InitialPose)
MovJ(RelPoint(P1, Offset))
Offset={CorX * i, 0, 0, 0}
end
–end

if I go with 2 loops it DOESN’T:

Offset={0, 0, 0, 0}
CorX=-50

for u=1,5,1 <- second loop
do <- second loop
for i=1,5,1
do
MovJ(InitialPose)
MovJ(RelPoint(P1, Offset)) <- RelPoint creates the problem, why??? above it works
Offset={CorX * i, 0, 0, 0}
end
end <- second loop

Any idea is highly appreciated.
Thanks
Chris

By adding Sleep(), it works…