Error stopping a for loop

So I am developing a game where your size increases every minute
and I created a gamepass where if you buy it, your growth will stop. I tried using the break statement but this does not seem to work.

Here is my code:

local mps = game:GetService("MarketplaceService")
local gamePassID = 31123235

game.Players.PlayerAdded:Connect(function(player)
	local size = 1 -- This
	player.CharacterAdded:Connect(function(Character)
		local Humanoid = player.Character.Humanoid
		Humanoid.BodyDepthScale.Value = size
		Humanoid.BodyHeightScale.Value = size
		Humanoid.BodyProportionScale.Value = size
		Humanoid.BodyTypeScale.Value = size
		Humanoid.BodyWidthScale.Value = size
		Humanoid.HeadScale.Value = size
		Humanoid.WalkSpeed = 16
		for x = (size+1), 999, 1 do --For loop where x + 1 each time the loop runs
			wait(60)
			size = x
			print(x) --Print in output
			Humanoid.BodyDepthScale.Value = x --Changing the values to x
			Humanoid.BodyHeightScale.Value = x
			Humanoid.BodyProportionScale.Value = x
			Humanoid.BodyTypeScale.Value = x
			Humanoid.BodyWidthScale.Value = x
			Humanoid.HeadScale.Value = x
			Humanoid.WalkSpeed = 16 + x*2
			Humanoid.JumpPower = 50 + x*2
			for v=1, 3 do
				if Humanoid.Health <= 0 then
					return
				end
				wait(1)
				if mps:PlayerOwnsAsset(player, gamePassID) then
					break
				end
			end
			if mps:PlayerOwnsAsset(player, gamePassID) then
				break
			end	
		end
	end)
end)

This is what I’ve tried so far

if mps:PlayerOwnsAsset(player, gamePassID) then
				break
			end

Thank You.

I don’t think you can go down like that in your for loops.
(Correct me if i’m wrong)

That is not the correct usage of a for loop.

for x = 2, 999 do

The x is the current amount of times the loop has ran. 2 is the starting number and 999 is the end number.

If you provided another argument say

for x= 2, 999, 2 do

The extra parameter will add 2 every time to the current number.

for x = (size+1), 999, 1 do
			wait(60)
			size = tonumber(x)

Changing the control variable’s value (first variable of a numeric for loop) is considered bad practice.

Bare in mind tonumber() can return nil if the passed value cannot be coerced into a number type value.