local l=TweenInfo.new(TWEEN_TIME,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,-1,true)local function d()if inTween==true then return end local d=CFrame.new(0,TWEEN_MOVE_DISTANCE,0)local Z=partToTween.CFrame:ToWorldSpace(d)local z=TweenService:Create(partToTween,l,{CFrame=Z})z:Play()inTween=true z.Completed:Connect(function()inTween=false end)end d()

local tweenInfo = TweenInfo.new(
	TWEEN_TIME,  -- Time
	Enum.EasingStyle.Quad,  -- EasingStyle
	Enum.EasingDirection.InOut,  -- EasingDirection
	-1,  -- RepeatCount (when less than zero the tween will loop indefinitely)
	true  -- Reverses (tween will reverse once reaching its goal)
)
local function startTween()
	-- If the part is already tweening, prevent it from starting a new tween
	if inTween == true then
		return
	end
	-- Calculate new CFrame for part position
	local offsetCFrame = CFrame.new(0, TWEEN_MOVE_DISTANCE, 0)
	local newCFrame = partToTween.CFrame:ToWorldSpace(offsetCFrame)
	-- Create a tween and play it
	local tweenPart = TweenService:Create(partToTween, tweenInfo, {CFrame = newCFrame})
	tweenPart:Play()
	inTween = true
	-- On tween completion, make part ready for another tween
	tweenPart.Completed:Connect(function()
		inTween = false
	end)
end

startTween()  -- Start the animation
