I dont get the error "Script timeout: exhausted allowed execution time" it should work

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    cylinders in a grid

  2. What is the issue? Include screenshots / videos if possible!
    it timeouts

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    adding waits

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

baseFlower = workspace.Flower
for x = math.floor(0-(script.Parent.Size.X/2)),math.floor(script.Parent.Size.X/2),4 do
	task.wait(1)
	for z = math.floor(0-(script.Parent.Size.Z/2)),math.floor(script.Parent.Size.Z/2),4 do
		
		
		task.wait()
		script.Parent.Attachment.Position = Vector3.new(x,script.Parent.Attachment.Position.Y,z)
		local flower = baseFlower:Clone()
		flower.Position = script.Parent.Attachment.WorldPosition
		local objectValue = Instance.new('ObjectValue')
		objectValue.Value = flower.Attachment
		objectValue.Parent = script.Parent
		flower.Parent = workspace.Flower
	end
end

2022-03-09 (2)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

this is not going to be a public game

Probally is task.wait(1) Is probally not enough so that probally exhausts the script
You can fix it by putting more wait in the loop:

for x = khJEFQUUHuf do
   wait(.1)
   for z = kmasdhbhjafAKHBF do
     wait(.1)
   end
end

And also a little tip:
You can wrap all z loops in a coroutine (Lua Side Tread)

for x = khJEFQUUHuf do
   wait(.1)
   coroutine.wrap(function()
     for z = kmasdhbhjafAKHBF do
       wait(.1)
     end
   end)()
end

This can help dividing the load of work

Increase the inner for loop’s yield.

@itsredstonepro
i tryed them both
the first reply managed to break my computer
but after i did what the second reply said
it did the same

i can access computer after restarting it

Then your computer can not handle the repeating thing, thtas just your computer cause it should work

edit: it works perfectly fine for me

forgot to mention that there are other scripts running

My guess is that your loops try to execute/repeat your logic too quickly?

I know for a fact that Roblox scripts can time-out if you do a lot of loops and do too much work in them without giving them time to catch some breath.