--WARNING!------------------------------------------------------------------------------------------------------------------------------------------
--DO NOT MODIFY THE CODE BELOW! (Unless you know what you're doing, in that case: go nuts!(Unless you're allergic to nuts of course. Then don't.))--
----------------------------------------------------------------------------------------------------------------------------------------------------

wait()

local motors = script.Parent._Motors:GetChildren()
local uiLabel = script.Parent.Status.SurfaceGui.TextLabel

for i=1,#motors do
	motors[i].Value.HingeConstraint.MotorMaxAcceleration = maxAcceleration
end

function Increase()
	if tonumber(uiLabel.Text) < maxValue then
		for i=1, #motors do
			motors[i].Value.HingeConstraint.AngularVelocity = motors[i].Value.HingeConstraint.AngularVelocity + increment
		end
		uiLabel.Text = uiLabel.Text + 1
	end
end

function Decrease()
	if tonumber(script.Parent.Status.SurfaceGui.TextLabel.Text) > minValue then
		for i=1, #motors do
			motors[i].Value.HingeConstraint.AngularVelocity = motors[i].Value.HingeConstraint.AngularVelocity - increment
		end
		uiLabel.Text = uiLabel.Text - 1
	end
end


script.Parent.Increase.ClickDetector.MouseClick:Connect(Increase)
script.Parent.Decrease.ClickDetector.MouseClick:Connect(Decrease)
