-- // Funtions


function toggleButton()
	local function toggleOn()
		if debounce then return end

		debounce = true

		frame:SetAttribute('enabled', true)

		TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {Position = onPosition}):Play()
		TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {BackgroundColor3 = onColor}):Play()

		task.wait(waitTime)

		debounce = false
	end

	local function toggleOff()
		if debounce then return end

		debounce = true

		frame:SetAttribute('enabled', false)

		TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {Position = offPosition}):Play()
		TweenService:Create(button, TweenInfo.new(waitTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {BackgroundColor3 = offColor}):Play()

		task.wait(waitTime)

		debounce = false
	end

	if frame:GetAttribute('enabled') then toggleOff() else toggleOn() end
end
