im just a newb that tries to code so for training i made a loop that makes grow the block every second. but after first one it stops. why it isnt looping?
local x = 1 local y = 1 local z = 1 local tag = Instance.new("Part") tag.Name = "Block" tag.BrickColor = BrickColor.new("Bright red") tag.Material = "Wood" tag.CanCollide = true tag.Parent = workspace tag.Position = Vector3.new(0,10,5) tag.Size = Vector3.new(x,y,z) local loop = 1 while (loop >= 1) do wait(1) tag.Size = Vector3.new(x ,y + 1 ,z ) end
Just write
while true do y = y + 1 wait(1) tag.Size = Vector3.new(x, y, z) end
Variable 'Y' is constant and it'll always be 1.
Here's what you can do to resolve this problem:
-- By the way, since you want the loop to be infinite, you could also use the condition as true, which makes it loop infinitely. while (true) do wait(1) y = y + 1 tag.Size = Vector3.new(x, y, z) end
thanks for all answers. will keep working for being good coders like you