Repeat until Doesn't work for me

I’m Making a Crop system But it Never prints After The Crop grows (Repeat until loop)

Here is the Script

local Crop = script.Parent
local WaitTime = 2
local PlantPercentage = Crop.Size.Y/1.5
local PlantGrown = Crop:WaitForChild("Grown")


local function GrowPlant()
	
	repeat 
	
		wait(WaitTime)
		PlantPercentage = PlantPercentage + 20 
		Crop.Size = Vector3.new(Crop.Size.X, Crop.Size.Y + 1/5, Crop.Size.Z)
	

	until PlantPercentage == 100
        print("Croo Fully Grown")
	PlantGrown.Value = true
	Crop.Size = Vector3.new(Crop.Size.X, math.ceil(Crop.Size.Y), Crop.Size.Z) 
end

if PlantGrow.Value == false then
      GrowPlant()
end

until PlantPercentage > 100
2 Likes

You are checking for exactly 100%, but

means that it won’t start on 0 percent, which means that the percentage likely is somewhere above 100%. Consider changing the until statement to this:

until PlantPercentage >= 100
1 Like

Thanks for helping me Once Again!

1 Like