local A = game.workspace.Part local B = game.workspace.Baseplate local BlocksAllowed = 10 local function Initialize_A() A.BrickColor = BrickColor.Random() local ACopy = A:Clone() ACopy.Parent = game.workspace end wait(2) while true do Initialize_A() wait(1) print("check") repeat Initialize_A() until Initialize_A() > 5 end
i don't know why you are trying to make a function a variable. you can easily solve this by calling the function.
local A = game.workspace.Part local B = game.workspace.Baseplate local BlocksAllowed = 10 local AmountOfClones = 0 function Initialize_A() A.BrickColor = BrickColor.Random() local ACopy = A:Clone() ACopy.Parent = game.workspace end wait(2) while true do Initialize_A() wait(1) print("check") repeat Initialize_A() AmountOfClones = AmountOfClones + 1 until AmountOfClones == 5 if AmountOfClones == 5 then break end end
I havn't tried it yet, but it looks to be clear!