-----------------------------------------------------------------------------------------------------
-- Coin Animation


local tweenService = game:GetService("TweenService")

local info = TweenInfo.new(
	3, -- length (seconds)
	Enum.EasingStyle.Back, -- easing style
	Enum.EasingDirection.InOut, -- easing direction
	-1, -- times repeated (-1 = infinite)
	true, -- should it reverse
	0 -- delay
) 

local function coinAnimation(coin)
	coin = coin.PrimaryPart
	wait()
	local goals = {
		Orientation = Vector3.new(0, 360, 0);
		Position = (coin.Position + Vector3.new(0, 1.5, 0));
	}
	local coinAnimation = tweenService:Create(coin, info, goals)
	coinAnimation:Play()
end
