-- This is not ideal in a server script.
-- CFraming should be done on the client for a less choppy experience.


local base = script.Parent:WaitForChild('Base')

local startCF = base.CFrame
local startTime = os.clock()
local tau = math.pi*2


local VERTICAL_SWING_AMOUNT = 90
local VERTICAL_SWING_TIME = 19

local HORIZONTAL_SWING_AMOUNT = 0
local HORIZONTAL_SWING_TIME = 6

while base and base.Parent do
	wait()
	local d = os.clock() - startTime
	base.CFrame = startCF * CFrame.Angles(0, math.sin(d*tau/HORIZONTAL_SWING_TIME)*math.rad(HORIZONTAL_SWING_AMOUNT)*.5, math.sin(d*tau/VERTICAL_SWING_TIME)*math.rad(VERTICAL_SWING_AMOUNT)*.5)
end
