I wanted all the spawns to rotate but only 1 is rotating

Code:

local TS = game:GetService("TweenService")
local TI = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false)
local goal = {Orientation = Vector3.new(0,180,0)}

local function rotate(p)
	local tween = TS:Create(p, TI, goal)
	while true do
		tween:Play()
		tween.Completed:Wait()
	end
end

for i,v in pairs(script.Parent:GetChildren())do
	if(v:IsA("SpawnLocation"))then
		v.Transparency = 1
		v.CanCollide = false
		rotate(v)
	end
end

Thank you for any help.