i already tried to make this:

local Temp = game.Workspace.Temp
local TempValue = game.Workspace.Temp.Value

while true do
	
	wait()
	
	Temp.Value = Temp.Value + 1
	
	if  TempValue >= 1000 then
		script:Destroy()
		
	end
end

Increasing is working perfectly fine, but it doesn't stop if reaches 1000.

Changing Script:Destroy() to script.Disabled = true does not work.

There is a way to fix this?

EDIT: i changed script:Destroy() into break which is fixed.