#For loop wont work

28 messages · Page 1 of 1 (latest)

high pier
#

So its this loop wont work(Code below). No errors, nothing, It just doesnt run.I checked what value I passed and if they are valid and all of them are good.

#

Code:

        for y = tablet["YRange"]["Min"], tablet["YRange"]["Max"], 1 do
            for z = tablet["ZRange"]["Min"], tablet["ZRange"]["Max"], 1 do
                print(x..", "..y..", "..z)
                
                local data = {
                    Position = Vector3.new(x,y,z),
                    Weight = (Vector3.new(x,y,z) - StartPosition).Magnitude + (Vector3.new(x,y,z) - EndPosition).Magnitude
                }
                table.insert(Grid, data)
            end
        end
    end
#

First loop, x value is -7 and the 2nd value is 3

#

and first loop doesnt work

mellow horizon
#

hihihihihihih

#

hellou

high pier
#

hihihihhi

mellow horizon
#

I see no issue ur code

#

what tablet is?

#

is iPad?

high pier
#

tablet named table

mellow horizon
#

["XRange"]["Min"] whats this value

#

tablet["XRange"]["Max"] and this

high pier
#

oh wait

#

I know the issue

mellow horizon
#

but why ur code so nested, its amazingly ugly

high pier
#

hold on

mellow horizon
high pier
high pier
#

rest are organized

mellow horizon
high pier
#

but hold on

#

I will try

mellow horizon
high pier
#

and let u know

#

Everything works

rose onyxBOT
#

studio** You are now Level 2! **studio