Script repeats a code many times, even though I didn't code it to

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!
    I got a submit order button in a ordering system, and when you submit the order, it should remove the frame, give a point to the cashier.
  2. What is the issue? Include screenshots / videos if possible!
    The point event line keeps looping itself, making it give me about 4 - 5 points, when it’s scripted to only give 1 point. The event should only give 1 point, since that’s what I scripted it to, and I used the same line of code in the claim order screen, and it only gave 1 point like it should.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried looking through the script, and doing research. Found nothing.
local order = {}
local click = true
local orderer = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
 if click and script.Parent.Parent.ListAmount.Value >= 1 and script.Parent.Parent.CustomerServe.Text ~= '' and game.Players:FindFirstChild(script.Parent.Parent.CustomerServe.Text) then
    script.Parent.Parent.Parent.Parent.Tablets.OpenMenu.Value = 'false'
	click = false

	for i, x in pairs(script.Parent.Parent.Order:GetChildren()) do
		if x:IsA("Frame") then
			table.insert(order,x.Name)
		end
	end

print(unpack(order));
wait(1)
game.ReplicatedStorage.Tablets:FireServer(order,script.Parent.Parent.TableNum.Value,script.Parent.Parent.CustomerServe.Text)

for i, x in pairs(script.Parent.Parent.Order:GetChildren()) do
	if x:IsA("Frame") then
		x:Destroy()
	end
end
for k in pairs (order) do
    order[k] = nil
end
  script.Parent.Parent.ListAmount.Value = 0
  script.Parent.Parent.TableNum.Value = ''
-----------------------------------------------------------------------------------

    script.Parent.Parent.CustomerServe.Text = ''
		for i, x in pairs(script.Parent.Parent:GetChildren()) do
			if x:IsA("ScrollingFrame") and x.Name ~= 'Display' or x:IsA("ScrollingFrame") and x.Name ~= 'Order' then
				x.Visible = false
		script.Parent.Parent:TweenPosition(UDim2.new(0.205, 0, 1.25, 0),"In", "Linear",1.0,true)
				wait (1)
		        script.Parent.Parent.Visible = false
				game.ReplicatedStorage.GivePoint:FireServer()
------------------------------------------------------------------------------------------
click = true
wait(script.Parent.Parent.OrderCoolDown.Value) 
				script.Parent.Parent.Parent.Parent.Tablets.OpenMenu.Value = 'true'
			end
		end
	end
end)
--Submit order button script.

Any help will be loved!

The for i, do are loops because if just try to get children with a local variable it would only get one children. Close it off where you don’t want it to loop.