Can't increase part by y axis

Hi! I’m trying to make a part increase by an increment of 1, on the X axis, 10 times. For some reason this doesn’t work, anyone know why?


Capture4364366346436436436

It looks like the issue might be with your for loop. You are using i++ as the increment, which is not a valid syntax in Lua. The correct syntax is i = i + 1 or i += 1 (but this is not supported in Lua). Try changing your for loop to:

for i = 1, 10 do
    part.Size = Vector3.new(part.Size.X + 1, part.Size.Y, part.Size.Z)
    wait(1)
end

This should make the part increase in size by 1 on the X axis, 10 times with a delay of 1 second between each increment.

1 Like

It works! Thanks for the explanation and help.

Stop using Chat GPT, you keep saying you arent. I just used it right now and i got the exact same answer as yours. I have the problem with you is lying about using it.

1 Like

Way off topic but could you send a picture of your syntax highlighting settings?

I like the look of it.

while the script provided is completely correct, seems your AI is getting something wrong?

  1. they aren’t using ++ and this issue is not with the for loop itself, but rather only the Size setting
  1. yeah, i += 1 is supported in lua (luau) and even if it wasn’t, i = i + 1 very much is supported in lua, not sure where you’re going either as that’s how a for loop actually works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.