local O=game:GetService("\082\117\110\083\101\114\118\105\099\101")function slerp(O,V,G)return O*((1+math.cos(G*math.pi))/2)+V*((1-math.cos(G*math.pi))/2)end local V=script.Parent local G=.0 local Q=V.Rotation O.Heartbeat:Connect(function(O)G+=(O/script.speed.Value)*2 if O<=1 then V.Rotation=slerp(-script.rotation.Value,script.rotation.Value,G)+Q else if O<=2 then V.Rotation=slerp(script.rotation.Value,-script.rotation.Value,G)+Q else G=0 end end end)


local RunService = game:GetService("RunService")
function slerp(a,b,x)
	return a*(((1+(math.cos(x*math.pi)))/2)) + b*(((1-(math.cos(x*math.pi)))/2))
end

local object = script.Parent
local count = 0.0
local rotation = object.Rotation	

RunService.Heartbeat:Connect(function(step)
	count += step / script.speed.Value * 2
	if step <= 1 then
		object.Rotation = slerp(-script.rotation.Value,script.rotation.Value,count)+rotation
	else if step <= 2 then
			object.Rotation = slerp(script.rotation.Value,-script.rotation.Value,count)+rotation
		else
			count = 0
		end
	end
end)
